Skip to content

CI: use Go 1.25 #3853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

CI: use Go 1.25 #3853

wants to merge 2 commits into from

Conversation

AkihiroSuda
Copy link
Member

No description provided.

@AkihiroSuda
Copy link
Member Author

Linter is noisy

https://github.com/lima-vm/lima/actions/runs/17033421798/job/48280540506?pr=3853

 Error: cmd/lima-guestagent/daemon_linux.go:89:29: net.Listen must not be called. use (*net.ListenConfig).Listen (noctx)
  		socketL, err := net.Listen("unix", socket)
  		                          ^
  Error: cmd/lima-guestagent/install_systemd_linux.go:69:22: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  		cmd := exec.Command("systemctl", append([]string{"--system"}, args...)...)
  		                   ^
  Error: cmd/limactl/copy.go:152:24: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	sshCmd := exec.Command(arg0, append(sshArgs, scpArgs...)...)
  	                      ^
  Error: cmd/limactl/hostagent.go:112:22: net.Listen must not be called. use (*net.ListenConfig).Listen (noctx)
  	l, err := net.Listen("unix", socket)
  	                    ^
  Error: cmd/limactl/shell.go:256:24: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	sshCmd := exec.Command(arg0, append(arg0Args, sshArgs...)...)
  	                      ^
  Error: cmd/limactl/tunnel.go:110:24: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	sshCmd := exec.Command(arg0, append(arg0Args, sshArgs...)...)
  	                      ^
  Error: pkg/autostart/autostart.go:100:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command(args[0], args[1:]...)
  	                   ^
  Error: pkg/downloader/downloader_test.go:323:34: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  		assert.NilError(t, exec.Command("gzip", localFile).Run())
  		                               ^
  Error: pkg/downloader/downloader_test.go:341:34: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  		assert.NilError(t, exec.Command("bzip2", localFile).Run())
  		                               ^
  Error: pkg/driver/external/client/client.go:29:19: net.Dial must not be called. use (*net.Dialer).DialContext (noctx)
  			return net.Dial("unix", socketPath)
  			               ^
  Error: pkg/driver/external/server/methods.go:81:30: net.Listen must not be called. use (*net.ListenConfig).Listen (noctx)
  		listener, err := net.Listen("unix", proxySocketPath)
  		                           ^
  Error: pkg/driver/external/server/server.go:54:29: net.Listen must not be called. use (*net.ListenConfig).Listen (noctx)
  	listener, err := net.Listen("unix", socketPath)
  	                           ^
  Error: pkg/driver/qemu/entitlementutil/entitlementutil.go:22:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command("codesign", "--verify", qExe)
  	                   ^
  Error: pkg/driver/qemu/entitlementutil/entitlementutil.go:29:20: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd = exec.Command("codesign", "--display", "--entitlements", "-", "--xml", qExe)
  	                  ^
  Error: pkg/driver/qemu/entitlementutil/entitlementutil.go:61:25: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	signCmd := exec.Command("codesign", "--sign", "-", "--entitlements", entName, "--force", qExe)
  	                       ^
  Error: pkg/driver/qemu/qemu.go:121:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command("qemu-img", args...)
  	                   ^
  Error: pkg/driver/qemu/qemu.go:156:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command("qemu-img", args...)
  	                   ^
  Error: pkg/driver/qemu/qemu.go:296:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command(exe, "-M", "none", "-accel", "help")
  	                   ^
  Error: pkg/driver/qemu/qemu.go:308:20: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd = exec.Command(exe, "-M", "none", "-netdev", "help")
  	                  ^
  Error: pkg/driver/qemu/qemu.go:320:20: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd = exec.Command(exe, "-machine", "help")
  	                  ^
  Error: pkg/driver/qemu/qemu.go:333:20: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd = exec.Command(exe, "-cpu", "help", "-machine", machine)
  	                  ^
  Error: pkg/driver/qemu/qemu.go:1037:23: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  			cmd := exec.Command(vhostCfg.Binary, "--version")
  			                   ^
  Error: pkg/driver/qemu/qemu.go:1140:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command(qemuExe, "--version")
  	                   ^
  Error: pkg/editutil/editutil.go:78:27: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	editorCmd := exec.Command(editor, tmpYAMLPath)
  	                         ^
  Error: pkg/executil/command.go:41:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  		cmd = exec.Command(args[0], args[1:]...)
  		                  ^
  Error: pkg/guestagent/iptables/iptables.go:133:32: net.DialTimeout must not be called. use (*net.Dialer).DialContext with (*net.Dialer).Timeout (noctx)
  			conn, err := net.DialTimeout("tcp", pt.AddrPort.String(), time.Second)
  			                            ^
  Error: pkg/hostagent/dns/dns.go:178:30: net.LookupIP must not be called. use (*net.Resolver).LookupIPAddr with a context (noctx)
  				addrs, err = net.LookupIP(cname)
  				                         ^
  Error: pkg/hostagent/dns/dns.go:209:33: net.LookupCNAME must not be called. use (*net.Resolver).LookupCNAME with a context (noctx)
  				cname, err = net.LookupCNAME(cname)
  				                            ^
  Error: pkg/hostagent/dns/dns.go:225:29: net.LookupTXT must not be called. use (*net.Resolver).LookupTXT with a context (noctx)
  			txt, err := net.LookupTXT(q.Name)
  			                         ^
  Error: pkg/hostagent/dns/dns.go:242:27: net.LookupNS must not be called. use (*net.Resolver).LookupNS with a context (noctx)
  			ns, err := net.LookupNS(q.Name)
  			                       ^
  Error: pkg/hostagent/dns/dns.go:258:27: net.LookupMX must not be called. use (*net.Resolver).LookupMX with a context (noctx)
  			mx, err := net.LookupMX(q.Name)
  			                       ^
  Error: pkg/hostagent/dns/dns.go:275:34: net.LookupSRV must not be called. use (*net.Resolver).LookupSRV with a context (noctx)
  			_, addrs, err := net.LookupSRV("", "", q.Name)
  			                              ^
  Error: pkg/imgutil/nativeimgutil/nativeimgutil_test.go:35:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	return exec.Command("qemu-img", "create", name, "-f", format, size).Run()
  	                   ^
  Error: pkg/ioutilx/ioutilx.go:53:26: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	out, err := exec.Command("cygpath", filepath.ToSlash(orig)).CombinedOutput()
  	                        ^
  Error: pkg/ioutilx/ioutilx.go:62:26: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	out, err := exec.Command("wsl", "-d", distro, "--exec", "wslpath", filepath.ToSlash(orig)).CombinedOutput()
  	                        ^
  Error: pkg/networks/reconcile/reconcile.go:74:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command("sudo", args...)
  	                   ^
  Error: pkg/networks/sudoers.go:61:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command("sudo", "-k")
  	                   ^
  Error: pkg/networks/sudoers.go:77:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  		cmd = exec.Command("sudo", "--user", user.User, "--group", user.Group, "--non-interactive", "true")
  		                  ^
  Error: pkg/networks/usernet/gvproxy.go:123:29: net.Listen must not be called. use (*net.ListenConfig).Listen (noctx)
  	listener, err := net.Listen("unix", opts.QemuSocket)
  	                           ^
  Error: pkg/networks/usernet/gvproxy.go:156:29: net.Listen must not be called. use (*net.ListenConfig).Listen (noctx)
  	listener, err := net.Listen("unix", opts.FdSocket)
  	                           ^
  Error: pkg/networks/usernet/recoincile.go:147:22: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  		cmd := exec.Command("/usr/bin/pkill", "-F", pidFile)
  		                   ^
  Error: pkg/osutil/machineid.go:35:44: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  		ioPlatformExpertDeviceCmd := exec.Command("/usr/sbin/ioreg", "-a", "-d2", "-c", "IOPlatformExpertDevice")
  		                                         ^
  Error: pkg/osutil/osutil_unix.go:29:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command("sysctl", "-n", name)
  	                   ^
  Error: pkg/osutil/user.go:164:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command(args[0], args[1:]...)
  	                   ^
  Error: pkg/portfwdserver/server.go:38:23: net.Dial must not be called. use (*net.Dialer).DialContext (noctx)
  	conn, err := net.Dial(in.Protocol, in.GuestAddr)
  	                     ^
  Error: pkg/qemuimgutil/qemuimgutil.go:53:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command("qemu-img", args...)
  	                   ^
  Error: pkg/qemuimgutil/qemuimgutil.go:132:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command("qemu-img", "convert", "-O", "raw", source, dest)
  	                   ^
  Error: pkg/qemuimgutil/qemuimgutil.go:152:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command("qemu-img", "info", "--output=json", "--force-share", f)
  	                   ^
  Error: pkg/qemuimgutil/qemuimgutil.go:170:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command("qemu-img", args...)
  	                   ^
  Error: pkg/sshutil/sshutil.go:109:29: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  			keygenCmd := exec.Command("ssh-keygen", "-t", "ed25519", "-q", "-N", "",
  			                         ^
  Error: pkg/sshutil/sshutil.go:384:21: os/exec.Command must not be called. use os/exec.CommandContext (noctx)
  	cmd := exec.Command(path, "-o", "GSSAPIAuthentication=no", "-V")
  	                   ^
  51 issues:
  * noctx: 51

@alexandear
Copy link
Member

Linter is noisy

lima-vm/lima/actions/runs/17033421798/job/48280540506?pr=3853

You can disable noctx in golangci-lint config for now. In future PRs, I will provide a more elegant solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants