diff --git a/README.md b/README.md index 151fc6518f4..1dc41f172c2 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ Ensure you have the following installed: - [yarn classic][yarn-classic] -- Go 1.21 or later. +- Go 1.22 or later. - Dependencies described in the [`node-gyp` docs][node-gyp] installation. This is required to install the [`ffi-napi`][ffi-napi] npm package. These docs mention diff --git a/src/go/docker-credential-none/go.mod b/src/go/docker-credential-none/go.mod index 1c706645fd1..88bf3a3076d 100644 --- a/src/go/docker-credential-none/go.mod +++ b/src/go/docker-credential-none/go.mod @@ -1,6 +1,6 @@ module github.com/rancher-sandbox/rancher-desktop/src/go/docker-credential-none -go 1.21 +go 1.22 require ( github.com/docker/cli v27.3.1+incompatible diff --git a/src/go/extension-proxy/go.mod b/src/go/extension-proxy/go.mod index a507f2167da..73cc55afd27 100644 --- a/src/go/extension-proxy/go.mod +++ b/src/go/extension-proxy/go.mod @@ -1,3 +1,3 @@ module github.com/rancher-sandbox/rancher-desktop/src/go/extension-port-forwarder -go 1.21 +go 1.22 diff --git a/src/go/github-runner-monitor/go.mod b/src/go/github-runner-monitor/go.mod index f0408c0b2fe..7e2021cb574 100644 --- a/src/go/github-runner-monitor/go.mod +++ b/src/go/github-runner-monitor/go.mod @@ -1,6 +1,6 @@ module github.com/rancher-sandbox/rancher-desktop/src/go/github-runner-monitor -go 1.21 +go 1.22 require ( github.com/google/go-github/v55 v55.0.0 diff --git a/src/go/mock-wsl/go.mod b/src/go/mock-wsl/go.mod index 264db235510..8b3bfc4be66 100644 --- a/src/go/mock-wsl/go.mod +++ b/src/go/mock-wsl/go.mod @@ -1,6 +1,6 @@ module github.com/rancher-sandbox/rancher-desktop/e2e/assets/mock-wsl -go 1.21 +go 1.22 require ( golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 diff --git a/src/go/nerdctl-stub/generate/go.mod b/src/go/nerdctl-stub/generate/go.mod index f2f9f8d0a88..5a14a4597ff 100644 --- a/src/go/nerdctl-stub/generate/go.mod +++ b/src/go/nerdctl-stub/generate/go.mod @@ -1,6 +1,6 @@ module github.com/rancher-sandbox/rancher-desktop/src/go/nerdctl-stub/generate -go 1.21 +go 1.22 require github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af diff --git a/src/go/nerdctl-stub/go.mod b/src/go/nerdctl-stub/go.mod index ee6ebb7b789..7ad3b402583 100644 --- a/src/go/nerdctl-stub/go.mod +++ b/src/go/nerdctl-stub/go.mod @@ -1,6 +1,6 @@ module github.com/rancher-sandbox/rancher-desktop/src/go/nerdctl-stub -go 1.21 +go 1.22 require ( github.com/hashicorp/go-multierror v1.1.1 diff --git a/src/go/rdctl/go.mod b/src/go/rdctl/go.mod index 0767ca043dc..186183f1699 100644 --- a/src/go/rdctl/go.mod +++ b/src/go/rdctl/go.mod @@ -1,6 +1,6 @@ module github.com/rancher-sandbox/rancher-desktop/src/go/rdctl -go 1.21 +go 1.22 require ( github.com/adrg/xdg v0.5.0 diff --git a/src/go/rdctl/pkg/runner/runner_test.go b/src/go/rdctl/pkg/runner/runner_test.go index c7f14a48dd0..4cc4be25ee1 100644 --- a/src/go/rdctl/pkg/runner/runner_test.go +++ b/src/go/rdctl/pkg/runner/runner_test.go @@ -14,7 +14,6 @@ func TestTaskRunner(t *testing.T) { taskRunner := NewTaskRunner(ctx) runOrder := make([]int, 0, 3) for i := 1; i < 4; i++ { - i := i taskRunner.Add(func() error { runOrder = append(runOrder, i) return nil @@ -66,7 +65,6 @@ func TestTaskRunner(t *testing.T) { expectedError := "func1 error" ranSlice := make([]bool, 2) for i := range ranSlice { - i := i taskRunner.Add(func() error { ranSlice[i] = true t.Logf("func%d ran", i+1) diff --git a/src/go/rdctl/pkg/snapshot/snapshotter_unix.go b/src/go/rdctl/pkg/snapshot/snapshotter_unix.go index 94965d92a28..70feed86c7e 100644 --- a/src/go/rdctl/pkg/snapshot/snapshotter_unix.go +++ b/src/go/rdctl/pkg/snapshot/snapshotter_unix.go @@ -95,7 +95,6 @@ func (snapshotter SnapshotterImpl) CreateFiles(ctx context.Context, appPaths pat taskRunner := runner.NewTaskRunner(ctx) files := snapshotter.Files(appPaths, snapshotDir) for _, file := range files { - file := file taskRunner.Add(func() error { err := copyFile(file.SnapshotPath, file.WorkingPath, file.CopyOnWrite, file.FileMode) if errors.Is(err, os.ErrNotExist) && file.MissingOk { @@ -126,7 +125,6 @@ func (snapshotter SnapshotterImpl) RestoreFiles(ctx context.Context, appPaths pa taskRunner := runner.NewTaskRunner(ctx) files := snapshotter.Files(appPaths, snapshotDir) for _, file := range files { - file := file taskRunner.Add(func() error { filename := filepath.Base(file.WorkingPath) err := copyFile(file.WorkingPath, file.SnapshotPath, file.CopyOnWrite, file.FileMode) diff --git a/src/go/rdctl/pkg/snapshot/snapshotter_windows.go b/src/go/rdctl/pkg/snapshot/snapshotter_windows.go index a764fbbcbbd..dd85e865330 100644 --- a/src/go/rdctl/pkg/snapshot/snapshotter_windows.go +++ b/src/go/rdctl/pkg/snapshot/snapshotter_windows.go @@ -73,7 +73,6 @@ func (snapshotter SnapshotterImpl) CreateFiles(ctx context.Context, appPaths pat // export WSL distros to snapshot directory for _, distro := range snapshotter.WSLDistros(appPaths) { - distro := distro taskRunner.Add(func() error { snapshotDistroPath := filepath.Join(snapshotDir, distro.Name+".tar") if err := snapshotter.ExportDistro(distro.Name, snapshotDistroPath); err != nil { @@ -119,7 +118,6 @@ func (snapshotter SnapshotterImpl) RestoreFiles(ctx context.Context, appPaths pa // restore WSL distros for _, distro := range snapshotter.WSLDistros(appPaths) { - distro := distro tr.Add(func() error { snapshotDistroPath := filepath.Join(snapshotDir, distro.Name+".tar") if err := os.MkdirAll(distro.WorkingDirPath, 0o755); err != nil { diff --git a/src/go/wsl-helper/pkg/wsl-utils/version_windows_test.go b/src/go/wsl-helper/pkg/wsl-utils/version_windows_test.go index 0d8d7827689..8cbf1070a25 100644 --- a/src/go/wsl-helper/pkg/wsl-utils/version_windows_test.go +++ b/src/go/wsl-helper/pkg/wsl-utils/version_windows_test.go @@ -103,7 +103,6 @@ func TestPackageVersion(t *testing.T) { {L: "1.0.0", R: "0.0.1", expect: false}, } for _, input := range cases { - input := input t.Run(fmt.Sprintf("%s<%s=%v", input.L, input.R, input.expect), func(t *testing.T) { var left, right PackageVersion assert.NoError(t, left.UnmarshalText([]byte(input.L))) @@ -175,8 +174,6 @@ func TestGetVersionFromCLI(t *testing.T) { logger.SetOutput(io.Discard) for name, input := range outputs { - name := name - input := input t.Run(name, func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) t.Cleanup(cancel)