run modernize -fix ./...

Using golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize

+ some manual cleanup in libpod/lock/shm/shm_lock_test.go as it
  generated an unused variable
+ restored one removed comment

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2025-09-08 18:22:43 +02:00
parent dc5a791f58
commit 8631032556
144 changed files with 500 additions and 623 deletions

View File

@@ -184,7 +184,7 @@ var _ = Describe("Podman pod create", func() {
Expect(err).ToNot(HaveOccurred())
confFile := filepath.Join(podmanTest.TempDir, "containers.conf")
err = os.WriteFile(confFile, []byte(fmt.Sprintf("[containers]\nbase_hosts_file=\"%s\"\n", configHosts)), 0755)
err = os.WriteFile(confFile, fmt.Appendf(nil, "[containers]\nbase_hosts_file=\"%s\"\n", configHosts), 0755)
Expect(err).ToNot(HaveOccurred())
os.Setenv("CONTAINERS_CONF_OVERRIDE", confFile)
if IsRemote() {
@@ -450,7 +450,7 @@ var _ = Describe("Podman pod create", func() {
// Create and replace 5 times in a row the "same" pod.
podName := "testCtr"
for i := 0; i < 5; i++ {
for range 5 {
session = podmanTest.Podman([]string{"pod", "create", "--replace", "--name", podName})
session.WaitWithDefaultTimeout()
Expect(session).Should(ExitCleanly())
@@ -862,7 +862,7 @@ ENTRYPOINT ["sleep","99999"]
}
m := make(map[string]string)
for i := 0; i < 5; i++ {
for i := range 5 {
podName := "testPod" + strconv.Itoa(i)
podCreate := podmanTest.Podman([]string{"pod", "create", "--userns=auto", "--name", podName})
podCreate.WaitWithDefaultTimeout()