From 1c3f434841cfcf54841ec347f7b7f854838b398d Mon Sep 17 00:00:00 2001 From: Rob O'Dwyer Date: Mon, 2 May 2022 13:57:07 -0700 Subject: [PATCH] DEV 1253: Upgrade to Go 1.18.1 (#70) * fix dependency that breaks on go 1.18.1 * upgrade to go 1.18.1 * upgrade golangci-lint to a version that works with go 1.18 --- .github/workflows/release.yml | 5 ++++- .github/workflows/test.yml | 13 ++++++++----- README.md | 4 ++-- cli/README.md | 4 ++-- go.mod | 4 ++-- go.sum | 2 ++ 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33c4568..e40d7c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,9 @@ on: tags: - '*' +env: + GO_VERSION: 1.18.1 + jobs: goreleaser: runs-on: ubuntu-latest @@ -18,7 +21,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.17 + go-version: '${{ env.GO_VERSION }}' - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6a1476c..acd54a7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,9 @@ name: Test on: [push, pull_request] +env: + GO_VERSION: 1.18.1 + jobs: format: @@ -11,7 +14,7 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-go@main with: - go-version: '1.17' + go-version: '${{ env.GO_VERSION }}' - name: Run gofmt run: test -z $(gofmt -l .) || (gofmt -d . && exit 1) @@ -23,10 +26,10 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-go@main with: - go-version: '1.17' + go-version: '${{ env.GO_VERSION }}' - name: Run golangci-lint run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.43.0 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2 golangci-lint run -v ./... test: @@ -37,7 +40,7 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-go@main with: - go-version: '1.17' + go-version: '${{ env.GO_VERSION }}' - name: Run go test run: go test -race -coverprofile=coverage.txt ./... - name: Upload coverage to codecov.io @@ -56,7 +59,7 @@ jobs: - uses: actions/checkout@main - uses: actions/setup-go@main with: - go-version: '1.17' + go-version: '${{ env.GO_VERSION }}' - name: Run go build run: | go build ./cli/battlesnake diff --git a/README.md b/README.md index 1ca6033..d636296 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,12 @@ This repo provides a simple CLI tool to run games locally against your dev envir Download precompiled binaries here:
[https://github.com/BattlesnakeOfficial/rules/releases](https://github.com/BattlesnakeOfficial/rules/releases) -Install as a Go package. Requires Go 1.17 or higher. [[Download](https://golang.org/dl/)] +Install as a Go package. Requires Go 1.18 or higher. [[Download](https://golang.org/dl/)] ``` go get github.com/BattlesnakeOfficial/rules/cli/battlesnake ``` -Compile from source. Also requires Go 1.17 or higher. +Compile from source. Also requires Go 1.18 or higher. ``` git clone git@github.com:BattlesnakeOfficial/rules.git cd rules diff --git a/cli/README.md b/cli/README.md index 7474b81..31ca88e 100644 --- a/cli/README.md +++ b/cli/README.md @@ -7,12 +7,12 @@ This tool allows running a Battlesnake game locally. There are several command-l Download precompiled binaries here:
[https://github.com/BattlesnakeOfficial/rules/releases](https://github.com/BattlesnakeOfficial/rules/releases) -Install as a Go package. Requires Go 1.17 or higher. [[Download](https://golang.org/dl/)] +Install as a Go package. Requires Go 1.18 or higher. [[Download](https://golang.org/dl/)] ``` go get github.com/BattlesnakeOfficial/rules/cli/battlesnake ``` -Compile from source. Also requires Go 1.17 or higher. +Compile from source. Also requires Go 1.18 or higher. ``` git clone git@github.com:BattlesnakeOfficial/rules.git cd rules diff --git a/go.mod b/go.mod index 892e8f2..4493ab8 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/BattlesnakeOfficial/rules -go 1.17 +go 1.18 require ( github.com/google/uuid v1.1.2 @@ -24,7 +24,7 @@ require ( github.com/spf13/jwalterweatherman v1.0.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect - golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 // indirect + golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect golang.org/x/text v0.3.2 // indirect gopkg.in/ini.v1 v1.51.0 // indirect gopkg.in/yaml.v2 v2.2.8 // indirect diff --git a/go.sum b/go.sum index b2b5e67..b1958f9 100644 --- a/go.sum +++ b/go.sum @@ -251,6 +251,8 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=