From c1b223d323694288c2f01ce9983c2f9553e29a27 Mon Sep 17 00:00:00 2001 From: Sarjono Mukti Aji Date: Sat, 16 Dec 2023 01:05:36 +0700 Subject: [PATCH] Update and test with Go v1.21 and v1.20 --- .github/workflows/reports.yml | 10 +++++----- .golangci.yml | 16 ++++------------ go.mod | 4 ++-- go.sum | 8 +++++--- 4 files changed, 16 insertions(+), 22 deletions(-) diff --git a/.github/workflows/reports.yml b/.github/workflows/reports.yml index c46fbe9..5c242ac 100644 --- a/.github/workflows/reports.yml +++ b/.github/workflows/reports.yml @@ -4,7 +4,7 @@ on: branches: - master pull_request: - types: [opened, synchronize, reopened] + types: [ opened, synchronize, reopened ] permissions: contents: read jobs: @@ -13,17 +13,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: [ '1.19', '1.18', '1.17' ] + go: [ '1.21', '1.20', '1.19', '1.18', '1.17' ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: v1.50.1 + version: v1.54.2 - name: Run Unit Tests run: ./test.sh - name: Send coverage diff --git a/.golangci.yml b/.golangci.yml index 077d673..5b8848f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -5,11 +5,9 @@ linters-settings: min-confidence: 0 gocyclo: min-complexity: 15 - maligned: - suggest-new: true goconst: - min-len: 2 - min-occurrences: 2 + min-len: 3 + min-occurrences: 3 misspell: locale: US lll: @@ -35,7 +33,6 @@ linters: # don't use --enable-all disable-all: true enable: - bodyclose - - deadcode - depguard - dogsled - dupl @@ -47,27 +44,22 @@ linters: # don't use --enable-all - gocyclo - gofmt - goimports - - golint - gosec - gosimple - govet - ineffassign - - interfacer - lll - misspell - nakedret - - scopelint + - revive - staticcheck - - structcheck - stylecheck - typecheck - unconvert - unparam - unused - - varcheck - whitespace - - maligned - +fast: true run: skip-dirs: - vendor/ diff --git a/go.mod b/go.mod index defd289..a11abc5 100644 --- a/go.mod +++ b/go.mod @@ -2,13 +2,13 @@ module github.com/simukti/sqldb-logger go 1.17 -require github.com/stretchr/testify v1.8.1 +require github.com/stretchr/testify v1.8.4 require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/kr/pretty v0.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/objx v0.5.0 // indirect + github.com/stretchr/objx v0.5.1 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index a1c221d..1098292 100644 --- a/go.sum +++ b/go.sum @@ -10,12 +10,14 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0= +github.com/stretchr/objx v0.5.1/go.mod h1:/iHQpkQwBD6DLUmQ4pE+s1TXdob1mORJ4/UFdrifcy0= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=