From f114f5c498052d36fce22bfdb5c9f282ea6cc4c0 Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Wed, 6 Sep 2023 19:32:59 +0200 Subject: [PATCH] bump go modules, update github workflows --- .github/workflows/ci-v2.yml | 29 ++++++++++++++--------------- .github/workflows/ci.yml | 25 ++++++++++++------------- .golangci.yml | 13 +------------ go.mod | 10 ++++++++-- go.sum | 13 ++++++------- v2/.golangci.yml | 26 +++----------------------- v2/go.mod | 8 ++++---- v2/go.sum | 13 ++++++------- 8 files changed, 54 insertions(+), 83 deletions(-) diff --git a/.github/workflows/ci-v2.yml b/.github/workflows/ci-v2.yml index 12a5324..c3d280f 100644 --- a/.github/workflows/ci-v2.yml +++ b/.github/workflows/ci-v2.yml @@ -17,14 +17,14 @@ jobs: runs-on: ubuntu-latest steps: - - name: set up go 1.18 - uses: actions/setup-go@v2 + - name: set up go + uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "1.20" id: go - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: build and test run: | @@ -32,17 +32,16 @@ jobs: go build -race working-directory: v2 - - name: install golangci-lint and goveralls - run: | - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $GITHUB_WORKSPACE v1.46.2 - GO111MODULE=off go get -u -v github.com/mattn/goveralls - - - name: run linters - run: $GITHUB_WORKSPACE/golangci-lint run --out-format=github-actions - working-directory: v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest + working-directory: v2 - - name: submit coverage - run: $(go env GOPATH)/bin/goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov + - name: install goveralls, submit coverage + run: | + go install github.com/mattn/goveralls@latest + goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov env: COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - working-directory: v2 \ No newline at end of file + working-directory: v2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f12846..85086fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,29 +17,28 @@ jobs: runs-on: ubuntu-latest steps: - - name: set up go 1.18 - uses: actions/setup-go@v2 + - name: set up go + uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: "1.20" id: go - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: build and test run: | go test -timeout=60s -race -covermode=atomic -coverprofile=$GITHUB_WORKSPACE/profile.cov go build -race - - name: install golangci-lint and goveralls - run: | - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $GITHUB_WORKSPACE v1.46.2 - GO111MODULE=off go get -u -v github.com/mattn/goveralls - - - name: run linters - run: $GITHUB_WORKSPACE/golangci-lint run --out-format=github-actions + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: latest - - name: submit coverage - run: $(go env GOPATH)/bin/goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov + - name: install goveralls, submit coverage + run: | + go install github.com/mattn/goveralls@latest + goveralls -service="github" -coverprofile=$GITHUB_WORKSPACE/profile.cov env: COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.golangci.yml b/.golangci.yml index 870d3a5..e71e5b5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -3,15 +3,8 @@ linters-settings: check-shadowing: true gocyclo: min-complexity: 15 - maligned: - suggest-new: true - goconst: - min-len: 2 - min-occurrences: 2 misspell: locale: US - lll: - line-length: 140 gocritic: enabled-tags: - performance @@ -22,22 +15,17 @@ linters-settings: linters: enable: - - megacheck - revive - govet - unconvert - megacheck - - structcheck - gas - gocyclo - dupl - misspell - unparam - - varcheck - - deadcode - typecheck - ineffassign - - varcheck - stylecheck - gochecknoinits - exportloopref @@ -45,6 +33,7 @@ linters: - nakedret - gosimple - prealloc + - unused fast: false disable-all: true diff --git a/go.mod b/go.mod index ef16ec1..c2c4e54 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,11 @@ module github.com/go-pkgz/expirable-cache -go 1.14 +go 1.20 -require github.com/stretchr/testify v1.7.1 +require github.com/stretchr/testify v1.8.4 + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum index 2dca7c9..fa4b6e6 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,10 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 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/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +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 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/v2/.golangci.yml b/v2/.golangci.yml index 492fc22..3143c29 100644 --- a/v2/.golangci.yml +++ b/v2/.golangci.yml @@ -1,19 +1,10 @@ linters-settings: govet: check-shadowing: true - golint: - min-confidence: 0 gocyclo: min-complexity: 15 - maligned: - suggest-new: true - goconst: - min-len: 2 - min-occurrences: 2 misspell: locale: US - lll: - line-length: 140 gocritic: enabled-tags: - performance @@ -24,26 +15,22 @@ linters-settings: linters: enable: + - gocritic - megacheck - revive - govet - unconvert - megacheck - #- structcheck - gas - gocyclo - dupl - misspell - #- unparam - - varcheck - - deadcode + - unused - typecheck - ineffassign - - varcheck - stylecheck - gochecknoinits - exportloopref - #- gocritic - nakedret - gosimple - prealloc @@ -54,11 +41,4 @@ run: output: format: tab skip-dirs: - - vendor - -issues: - exclude-rules: - - text: "should have a package comment, unless it's in another file for this package" - linters: - - golint - exclude-use-default: false + - vendor \ No newline at end of file diff --git a/v2/go.mod b/v2/go.mod index 0fda1c4..558cc25 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -1,11 +1,11 @@ module github.com/go-pkgz/expirable-cache/v2 -go 1.18 +go 1.20 -require github.com/stretchr/testify v1.7.1 +require github.com/stretchr/testify v1.8.4 require ( - github.com/davecgh/go-spew v1.1.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/v2/go.sum b/v2/go.sum index 2dca7c9..fa4b6e6 100644 --- a/v2/go.sum +++ b/v2/go.sum @@ -1,11 +1,10 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 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/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +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 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=