From 5754f417b8e0ab568e73b4713b9d0dcac7251278 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 19 Feb 2021 11:43:54 +0100 Subject: [PATCH 1/2] .github: run gofmt only with Go 1.16 In the past there occasionally have been changes in gofmt behavior between Go versions. In order to avoid these, only run gofmt from the latest Go version, i.e. currently Go 1.16. Follow-up for commit 656b9db2d3ca (".github: use matrix strategy and test with Go 1.15 as well") Signed-off-by: Tobias Klauser --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d4d0632..ea3a91a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,6 +24,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - name: Format + if: matrix.go-version >= '1.16' run: test -z $(gofmt -l .) - name: Build run: go build From 3ba5d29b2bb11045d280a8657e00a1e2c8b5386e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 19 Feb 2021 11:45:17 +0100 Subject: [PATCH 2/2] .github: run staticcheck as part of CI Signed-off-by: Tobias Klauser --- .github/workflows/tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ea3a91a..f2501eb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,5 +30,11 @@ jobs: run: go build - name: Vet run: go vet + - name: Install and run staticcheck + if: matrix.go-version >= '1.16' + run: | + go install honnef.co/go/tools/cmd/staticcheck@v0.1.2 + staticcheck -version + staticcheck -- ./... - name: Run unit tests run: go test -v -race -cover