From 716322cdf88835f1c033b3b2dc64cc03009f4346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Fri, 25 Aug 2023 21:37:21 +0100 Subject: [PATCH] all: start suggesting Go 1.21 and testing on it Also note that the first release is now 1.21.0, so we no longer need to use the awkward 1.21.x notation in warnings. --- .github/workflows/test.yml | 15 ++++++++------- main.go | 2 +- testdata/script/goversion.txtar | 12 ++++++------ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6dd06ef..4da1101 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: test: strategy: matrix: - go-version: [1.20.x] + go-version: [1.20.x, 1.21.x] os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: @@ -53,17 +53,17 @@ jobs: # Static checks from this point forward. Only run on one Go version and on # linux, since it's the fastest platform, and the tools behave the same. - name: Test third-party project builds - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' + if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x' run: | go install ./scripts/check-third-party.sh - - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' + - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x' run: ./scripts/crlf-test.sh - - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' + - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x' run: diff <(echo -n) <(gofmt -d .) - - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' + - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x' run: go vet ./... - - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' + - if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.21.x' uses: dominikh/staticcheck-action@v1 with: version: "2023.1.3" @@ -81,11 +81,12 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: 1.20.x + go-version: 1.21.x cache: false - run: go test -short ./... test-gotip: + if: false # let tip for 1.22 settle first runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/main.go b/main.go index fb3cfe6..d1c836d 100644 --- a/main.go +++ b/main.go @@ -268,7 +268,7 @@ func (e errJustExit) Error() string { return fmt.Sprintf("exit: %d", e) } func goVersionOK() bool { const ( minGoVersionSemver = "v1.20.0" - suggestedGoVersion = "1.20.x" + suggestedGoVersion = "1.21" ) // rxVersion looks for a version like "go1.2" or "go1.2.3" diff --git a/testdata/script/goversion.txtar b/testdata/script/goversion.txtar index 1b6605f..c34a265 100644 --- a/testdata/script/goversion.txtar +++ b/testdata/script/goversion.txtar @@ -7,30 +7,30 @@ env PATH=${WORK}/.bin${:}${PATH} # An empty go version. env TOOLCHAIN_GOVERSION='' ! exec garble build -stderr 'Go version is too old; please upgrade to Go 1\.20\.x or newer' +stderr 'Go version is too old; please upgrade to Go 1\.21 or newer' # We should error on a devel version that's too old. # Note that they lacked the "goN.M-" prefix. env TOOLCHAIN_GOVERSION='devel +afb5fca Sun Aug 07 00:00:00 2020 +0000' ! exec garble build -stderr 'Go version is too old; please upgrade to Go 1\.20\.x or newer' +stderr 'Go version is too old; please upgrade to Go 1\.21 or newer' # Another form of old version; with an old "goN.M-" prefix. env TOOLCHAIN_GOVERSION='devel go1.15-afb5fca Sun Aug 07 00:00:00 2020 +0000' ! exec garble build -stderr 'Go version "devel go1\.15-.*2020.*" is too old; please upgrade to Go 1\.20\.x' +stderr 'Go version "devel go1\.15-.*2020.*" is too old; please upgrade to Go 1\.21' # A current devel version should be fine. # Note that we don't look at devel version timestamps. -env GARBLE_TEST_GOVERSION='go1.20' -env TOOLCHAIN_GOVERSION='devel go1.20-ad97d204f0 Sun Sep 12 16:46:58 2023 +0000' +env GARBLE_TEST_GOVERSION='go1.21' +env TOOLCHAIN_GOVERSION='devel go1.21-ad97d204f0 Sun Sep 12 16:46:58 2023 +0000' ! exec garble build stderr 'mocking the real build' # We should error on a stable version that's too old. env TOOLCHAIN_GOVERSION='go1.14' ! exec garble build -stderr 'Go version "go1\.14" is too old; please upgrade to Go 1\.20\.x or newer' +stderr 'Go version "go1\.14" is too old; please upgrade to Go 1\.21 or newer' # We should accept a future stable version. # Note that we need to bump the version of Go that supposedly built it, too.