mirror of
https://github.com/containers/podman.git
synced 2026-06-02 04:49:04 -04:00
cleanup: run go fix on pkg/machine for windows
Signed-off-by: jait jacob <jai8.jacob@gmail.com>
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user