From 797aa23bbfa7cf0bab0b744696feb4de387bacf5 Mon Sep 17 00:00:00 2001 From: Eric Powers Date: Mon, 18 Sep 2023 10:43:58 -0700 Subject: [PATCH] Update: Add golang v1.20 and v1.21 to build (#5) * Update: Add golang v1.20 and v1.21 to build * Update: Only run golang v1.20 and v1.21 --- .github/workflows/build-go.yaml | 20 ++++---------------- Makefile | 7 ++----- printer.go | 4 ++-- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-go.yaml b/.github/workflows/build-go.yaml index 1973919..bae8504 100644 --- a/.github/workflows/build-go.yaml +++ b/.github/workflows/build-go.yaml @@ -19,13 +19,12 @@ jobs: fail-fast: false matrix: go: - - 1.17 - - 1.18 - - 1.19 + - "1.20" + - "1.21" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: actions/setup-go@v2 + - uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} @@ -35,17 +34,6 @@ jobs: go install github.com/securego/gosec/cmd/gosec@latest go install github.com/axw/gocov/gocov@master go install github.com/AlekSi/gocov-xml@latest - - - name: setup-for-older-go - if: ${{ matrix.go <= 1.17 }} - run: | - # stay on an older version of golangci-lint which still builds against 1.17 - # This is due to the introduction of generics. - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.3 - - - name: setup-for-newer-go - if: ${{ matrix.go > 1.17 }} - run: | go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest - name: build diff --git a/Makefile b/Makefile index 6e1c367..13be224 100644 --- a/Makefile +++ b/Makefile @@ -16,10 +16,7 @@ lint: --enable=ineffassign \ --enable=revive \ --enable=unused \ - --enable=structcheck \ --enable=staticcheck \ - --enable=varcheck \ - --enable=deadcode \ --enable=unconvert \ --enable=misspell \ --enable=prealloc \ @@ -32,8 +29,8 @@ test: @ echo "Converting the coverage file..." gocov convert ./unit_coverage.cov | gocov-xml > ./coverage.xml integration: - go run examples/tests/main.go test - go run examples/suites/main.go test + go run examples/tests/main.go test + go run examples/suites/main.go test sec: gosec -quiet ./... diff --git a/printer.go b/printer.go index f02979d..9093b6a 100644 --- a/printer.go +++ b/printer.go @@ -14,7 +14,7 @@ import ( var printLock = &sync.Mutex{} -func printSetupError(id, suite, name string, recovery interface{}, err error) { +func printSetupError(id, _, name string, recovery interface{}, err error) { printLock.Lock() defer printLock.Unlock() @@ -74,7 +74,7 @@ func createHeader(currTest testRun, results []testResult, showOnSuccess bool) (f goterm.GREEN, ) currTest.testInfo.WriteHeader([]byte(output)) // nolint - return + return failed } color := goterm.GREEN