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

@@ -18,13 +18,13 @@ import (
func createContainersConfFileWithDevices(pTest *PodmanTestIntegration, devices string, cdiSpecDirs []string) {
configPath := filepath.Join(pTest.TempDir, "containers.conf")
containersConf := []byte(fmt.Sprintf("[containers]\ndevices = [%s]\n", devices))
containersConf := fmt.Appendf(nil, "[containers]\ndevices = [%s]\n", devices)
if len(cdiSpecDirs) > 0 {
quoted := make([]string, len(cdiSpecDirs))
for i, dir := range cdiSpecDirs {
quoted[i] = fmt.Sprintf("%q", dir)
}
containersConf = append(containersConf, []byte(fmt.Sprintf("[engine]\ncdi_spec_dirs = [%s]\n", strings.Join(quoted, ", ")))...)
containersConf = append(containersConf, fmt.Appendf(nil, "[engine]\ncdi_spec_dirs = [%s]\n", strings.Join(quoted, ", "))...)
}
err := os.WriteFile(configPath, containersConf, os.ModePerm)
Expect(err).ToNot(HaveOccurred())