Skip to content

Commit

Permalink
Update: Support golang 1.19 (#102)
Browse files Browse the repository at this point in the history
* Update: Support golang 1.19

* Update: remove gosec from default for now

* Fixed: Update unit test with newer golang
  • Loading branch information
Eric Powers authored Aug 18, 2022
1 parent 3409e27 commit d8acfa4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/build-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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/[email protected]
- 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: |
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SHELL := /bin/bash -o pipefail

export GO111MODULE = on

default: lint test sec
default: lint test

lint:
golangci-lint run \
Expand All @@ -12,7 +12,7 @@ lint:
--enable=errcheck \
--enable=goimports \
--enable=ineffassign \
--enable=golint \
--enable=revive \
--enable=unused \
--enable=structcheck \
--enable=staticcheck \
Expand Down
1 change: 1 addition & 0 deletions logutils/sigtrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lombric/lombric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit d8acfa4

Please sign in to comment.