diff --git a/.github/workflows/build-go.yaml b/.github/workflows/build-go.yaml index d53a145..2f5dcc9 100644 --- a/.github/workflows/build-go.yaml +++ b/.github/workflows/build-go.yaml @@ -19,8 +19,9 @@ jobs: fail-fast: false matrix: go: - - 1.15 - - 1.16 + - 1.17 + - 1.18 + - 1.19 steps: - uses: actions/checkout@v2 @@ -31,11 +32,22 @@ jobs: - name: setup run: | go version - go get github.com/golangci/golangci-lint/cmd/golangci-lint@latest - go get github.com/securego/gosec/cmd/gosec - #go get golang.org/x/tools/cmd/cover - go get github.com/axw/gocov/gocov - go get github.com/AlekSi/gocov-xml + go install github.com/securego/gosec/cmd/gosec@latest + #go install golang.org/x/tools/cmd/cover@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 run: | diff --git a/Makefile b/Makefile index 0c00f90..58dbf5a 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ SHELL := /bin/bash -o pipefail export GO111MODULE = on -default: lint test sec +default: lint test lint: golangci-lint run \ @@ -12,7 +12,7 @@ lint: --enable=errcheck \ --enable=goimports \ --enable=ineffassign \ - --enable=golint \ + --enable=revive \ --enable=unused \ --enable=structcheck \ --enable=staticcheck \ diff --git a/logutils/sigtrap.go b/logutils/sigtrap.go index 30335d3..67ee47b 100644 --- a/logutils/sigtrap.go +++ b/logutils/sigtrap.go @@ -9,6 +9,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux || darwin // +build linux darwin package logutils diff --git a/lombric/lombric_test.go b/lombric/lombric_test.go index 66f0613..1f71b85 100644 --- a/lombric/lombric_test.go +++ b/lombric/lombric_test.go @@ -115,7 +115,7 @@ func TestLombric_Initialize(t *testing.T) { So(conf.AString, ShouldEqual, "hello") So(conf.AStringNoDef, ShouldEqual, "") So(conf.AStringSlice, ShouldResemble, []string{"a", "b", "c"}) - So(conf.AStringSliceNoDef, ShouldResemble, []string(nil)) + So(conf.AStringSliceNoDef, ShouldResemble, []string{}) So(conf.EmbeddedIgnoredStringB, ShouldEqual, "") So(conf.EmbeddedStringA, ShouldEqual, "outter1") So(conf.EmbeddedStringB, ShouldEqual, "inner2")