diff --git a/.appveyor.yml b/.appveyor.yml index 4a6eac8..e94deea 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,7 +7,7 @@ image: Visual Studio 2015 environment: GOPATH: c:\gopath GO111MODULE: on - GVM_GO_VERSION: 1.17.8 + GVM_GO_VERSION: 1.18.5 GVM_DL: https://github.com/andrewkroh/gvm/releases/download/v0.4.1/gvm-windows-amd64.exe # Custom clone folder (variables are not expanded here). diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 38268a7..29246bc 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,14 +14,13 @@ jobs: strategy: matrix: go-version: - - 1.17 - 1.18 + - 1.19 steps: - - name: checkout - uses: actions/checkout@master + - uses: actions/checkout@v3 - name: set up Go - uses: actions/setup-go@v1 + uses: actions/setup-go@v3 with: go-version: ${{ matrix.go-version }} @@ -39,7 +38,7 @@ jobs: - name: cross build with goreleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v3 with: distribution: goreleaser version: latest diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index d9b0514..3089fb6 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -16,8 +16,13 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/setup-go@v3 + with: + go-version: 1.18 + + - uses: actions/checkout@v3 + - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: - version: v1.44.2 + version: v1.47.0 diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 43db929..b47b9a4 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -11,17 +11,17 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: '1.17' + go-version: '1.18' - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v3 with: distribution: goreleaser version: latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 08e86dc..2198c2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Changed +- Updated releases to use Go 1.18. [#54](https://github.com/andrewkroh/gvm/pull/54) + ### Fixed - Fix `--arch` flag and associated `GVM_ARCH` env variable. [#53](https://github.com/andrewkroh/gvm/pull/53) diff --git a/cmd/gvm/use_test.go b/cmd/gvm/use_test.go index 06136e6..dca6ff2 100644 --- a/cmd/gvm/use_test.go +++ b/cmd/gvm/use_test.go @@ -2,6 +2,7 @@ package main import ( "bytes" + "errors" "fmt" "io" "os" @@ -71,9 +72,17 @@ func TestGVMRunUse(t *testing.T) { } // Test that GOROOT/bin/go exists and is the correct version. - version, err := exec.Command(filepath.Join(goroot, "bin", "go"), "version").Output() + goVersionCmd := exec.Command(filepath.Join(goroot, "bin", "go"), "version") + goVersionCmd.Env = append(goVersionCmd.Env, "GOROOT="+goroot) + + version, err := goVersionCmd.Output() if err != nil { - t.Fatal("failed to run go version", err) + var exitErr *exec.ExitError + if errors.As(err, &exitErr) { + t.Fatalf("failed to run go version: %v\n%s", err, exitErr.Stderr) + } else { + t.Fatal("failed to run go version", err) + } } assert.Contains(t, string(version), tc.Version) })