Skip to content

Commit

Permalink
Bump go version to 1.22
Browse files Browse the repository at this point in the history
Notably this picks up the copyloopvar change.

Signed-off-by: Mark Yen <mark.yen@suse.com>
  • Loading branch information
mook-as committed Oct 3, 2024
1 parent 2db4a54 commit 819557f
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/go/docker-credential-none/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/go/extension-proxy/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/rancher-sandbox/rancher-desktop/src/go/extension-port-forwarder

go 1.21
go 1.22
2 changes: 1 addition & 1 deletion src/go/github-runner-monitor/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/go/mock-wsl/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/go/nerdctl-stub/generate/go.mod
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/go/nerdctl-stub/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/go/rdctl/go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/go/rdctl/pkg/runner/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions src/go/rdctl/pkg/snapshot/snapshotter_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions src/go/rdctl/pkg/snapshot/snapshotter_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 0 additions & 3 deletions src/go/wsl-helper/pkg/wsl-utils/version_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 819557f

Please sign in to comment.