cleanup: run go fix on pkg/machine for windows

Signed-off-by: jait jacob <jai8.jacob@gmail.com>
This commit is contained in:
jait jacob
2026-04-26 15:30:41 +05:30
committed by Jait Jacob
parent 991cde5167
commit efc6ddfcc4
4 changed files with 4 additions and 9 deletions

View File

@@ -174,7 +174,7 @@ var _ = Describe("podman machine init - windows only", func() {
newFileServerVsocks, err := vsock.LoadAllHVSockRegistryEntriesByPurpose(vsock.Fileserver)
Expect(err).ToNot(HaveOccurred())
Expect(newFileServerVsocks).To(HaveLen(countFileServerVsocks))
for i := 0; i < countFileServerVsocks; i++ {
for i := range countFileServerVsocks {
Expect(newFileServerVsocks[i].Port).To(Equal(fileServerVsocks[i].Port))
}

View File

@@ -174,7 +174,7 @@ func (hv *HVSockRegistryEntry) exists() (bool, error) {
// already being used by another hvsock in the Windows registry.
func findOpenHVSockPort() (uint64, error) {
// If we cannot find a free port in 10 attempts, something is wrong
for i := 0; i < 10; i++ {
for range 10 {
port, err := utils.GetRandomPort()
if err != nil {
return 0, err

View File

@@ -82,7 +82,7 @@ func PipeNameAvailable(pipeName string, maxWait time.Duration) bool {
func WaitPipeExists(pipeName string, retries int, checkFailure func() error) error {
var err error
for i := 0; i < retries; i++ {
for range retries {
err = fileutils.Exists(`\\.\pipe\` + pipeName)
if err == nil {
break

View File

@@ -210,12 +210,7 @@ func wrapMaybef(err error, format string, args ...any) error {
// IsReExecuting checks if the current process was re-executed with --reexec flag
func IsReExecuting() bool {
for _, arg := range os.Args {
if arg == "--reexec" {
return true
}
}
return false
return slices.Contains(os.Args, "--reexec")
}
func CreateOrTruncateElevatedOutputFile() error {