bump go to 1.22

Many dependencies started using go 1.22 which means we have to follow in
order to update.

Disable the now depracted exportloopref linter as it was replaced by
copyloopvar as go fixed the loop copy problem in 1.22[1]

Another new chnage in go 1.22 is the for loop syntax over ints, the
intrange linter chacks for this but there a lot of loops that have to be
converted so I didn't do it here and disable th elinter for now, th eold
syntax is still fine.

[1] https://go.dev/blog/loopvar-preview

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2024-09-03 13:41:53 +02:00
parent d03e8ffc56
commit f93fcf7dee
23 changed files with 3 additions and 40 deletions

View File

@ -1118,9 +1118,6 @@ var _ = Describe("Podman checkpoint", func() {
share,
)
share := share // copy into local scope, for use inside function
index := index
It(testName, func() {
podName := "test_pod"

View File

@ -217,7 +217,6 @@ var _ = Describe("Podman healthcheck run", func() {
// Run this test with and without healthcheck events, even without events
// podman inspect and ps should still show accurate healthcheck results.
for _, hcEvent := range []bool{true, false} {
hcEvent := hcEvent
testName := "hc_events=" + strconv.FormatBool(hcEvent)
It("podman healthcheck single healthy result changes failed to healthy "+testName, func() {
if !hcEvent {

View File

@ -35,8 +35,6 @@ var _ = Describe("Podman logs", func() {
})
for _, log := range []string{"k8s-file", "journald", "json-file"} {
// This is important to move the 'log' var to the correct scope under Ginkgo flow.
log := log
// Flake prevention: journalctl makes no timeliness guarantees
logTimeout := time.Millisecond

View File

@ -549,7 +549,6 @@ var _ = Describe("Podman network", func() {
})
for _, opt := range []string{"-o=parent=lo", "--interface-name=lo"} {
opt := opt
It(fmt.Sprintf("podman network create/remove macvlan as driver (-d) with %s", opt), func() {
net := "macvlan" + stringid.GenerateRandomID()
nc := podmanTest.Podman([]string{"network", "create", "-d", "macvlan", opt, net})

View File

@ -417,7 +417,6 @@ var _ = Describe("Podman pod create", func() {
tests := []string{"", "none"}
for _, test := range tests {
test := test
It("podman pod create --share="+test+" should not create an infra ctr", func() {
session := podmanTest.Podman([]string{"pod", "create", "--share", test})
session.WaitWithDefaultTimeout()

View File

@ -62,7 +62,6 @@ var _ = Describe("Podman run memory", func() {
})
for _, limit := range []string{"0", "15", "100"} {
limit := limit // Keep this value in a proper scope
testName := fmt.Sprintf("podman run memory-swappiness test(%s)", limit)
It(testName, func() {
SkipIfCgroupV2("memory-swappiness not supported on cgroupV2")

View File

@ -548,7 +548,6 @@ EXPOSE 2004-2005/tcp`, ALPINE)
})
for _, local := range []bool{true, false} {
local := local
testName := "HostIP"
if local {
testName = "127.0.0.1"