From 195034a470dfd4c023e26c2e5a491a11d7d7cd85 Mon Sep 17 00:00:00 2001 From: Michel Loiseleur Date: Mon, 19 Feb 2024 15:42:16 +0100 Subject: [PATCH] chore: update go, lint, ci and go modules --- .github/workflows/ci.yml | 17 ++++------------- .github/workflows/go-cross.yml | 24 +++--------------------- .github/workflows/release.yml | 16 ++++------------ .golangci.yml | 1 + go.mod | 4 ++-- go.sum | 6 ++---- 6 files changed, 16 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1379ec..f612cd1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,33 +12,24 @@ jobs: name: Main Process runs-on: ubuntu-latest env: - GO_VERSION: '1.20' - GOLANGCI_LINT_VERSION: v1.52.2 + GO_VERSION: '1.22' + GOLANGCI_LINT_VERSION: v1.55.2 CGO_ENABLED: 0 steps: # https://github.com/marketplace/actions/setup-go-environment - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} # https://github.com/marketplace/actions/checkout - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - # https://github.com/marketplace/actions/cache - - name: Cache Go modules - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Check and get dependencies run: | go mod download diff --git a/.github/workflows/go-cross.yml b/.github/workflows/go-cross.yml index 62e7362..d9cacfb 100644 --- a/.github/workflows/go-cross.yml +++ b/.github/workflows/go-cross.yml @@ -16,37 +16,19 @@ jobs: strategy: matrix: - go-version: [ '1.19', 1.x ] + go-version: [ '1.22.0' ] os: [ubuntu-latest, macos-latest, windows-latest] steps: # https://github.com/marketplace/actions/setup-go-environment - name: Set up Go ${{ matrix.go-version }} - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} # https://github.com/marketplace/actions/checkout - name: Checkout code - uses: actions/checkout@v2 - - # https://github.com/marketplace/actions/cache - - name: Cache Go modules - uses: actions/cache@v3 - with: - # In order: - # * Module download cache - # * Build cache (Linux) - # * Build cache (Mac) - # * Build cache (Windows) - path: | - ~/go/pkg/mod - ~/.cache/go-build - ~/Library/Caches/go-build - %LocalAppData%\go-build - key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.go-version }}-go- + uses: actions/checkout@v4 - name: Test run: go test -v -cover ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index be07aed..b62130a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,34 +9,26 @@ jobs: name: Release Process runs-on: ubuntu-latest env: - GO_VERSION: '1.20' + GO_VERSION: '1.22' CGO_ENABLED: 0 steps: # https://github.com/marketplace/actions/setup-go-environment - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} # https://github.com/marketplace/actions/checkout - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - # https://github.com/marketplace/actions/cache - - name: Cache Go modules - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-release-${{ hashFiles('**/go.sum') }} - restore-keys: ${{ runner.os }}-go-release- - # https://goreleaser.com/ci/actions/ - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v5 with: version: latest args: release --rm-dist diff --git a/.golangci.yml b/.golangci.yml index 77ec35f..22b5112 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -87,6 +87,7 @@ linters: - ireturn - errchkjson - contextcheck + - depguard issues: exclude-use-default: false diff --git a/go.mod b/go.mod index c622244..9dae2ca 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/traefik/mocktail -go 1.19 +go 1.22 require ( - github.com/ettle/strcase v0.1.1 + github.com/ettle/strcase v0.2.0 github.com/stretchr/testify v1.8.1 ) diff --git a/go.sum b/go.sum index 5ab6cb8..eb22b76 100644 --- a/go.sum +++ b/go.sum @@ -1,21 +1,19 @@ 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/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= -github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= +github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= +github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= 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/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= 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= 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.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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=