Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: bump golangci-lint to v1.51.1, test against Go v1.20, drop support for Go v1.18 #52

Merged
merged 2 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
main:
strategy:
matrix:
go-version: [1.18, 1.19]
go-version: ["1.19", "1.20"]
runs-on: ubuntu-latest
steps:
- name: Install Go
Expand All @@ -28,20 +28,20 @@ jobs:
- name: Run static checks
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5
with:
version: v1.50.1
version: v1.51.1
args: --config=.golangci.yml --verbose --out-${NO_FUTURE}format colored-line-number
skip-cache: true
- name: Check module tidiness
run: |
go mod tidy -compat=1.18
go mod tidy -compat=1.19
go mod verify
test -z "$(git status --porcelain)" || (echo "please run 'go mod tidy -compat=1.18', and commit your changes"; exit 1)
test -z "$(git status --porcelain)" || (echo "please run 'go mod tidy -compat=1.19', and commit your changes"; exit 1)
- name: Run unit tests
run: make test
cmd:
strategy:
matrix:
go-version: [1.18, 1.19]
go-version: ["1.19", "1.20"]
runs-on: ubuntu-latest
steps:
- name: Install Go
Expand All @@ -57,22 +57,22 @@ jobs:
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5
with:
working-directory: ./cmd
version: v1.50.1
version: v1.51.1
args: --config=../.golangci.yml --verbose --out-${NO_FUTURE}format colored-line-number
skip-cache: true
- name: Check module tidiness
working-directory: ./cmd
run: |
go mod tidy -compat=1.18
go mod tidy -compat=1.19
go mod verify
test -z "$(git status --porcelain)" || (echo "please run 'go mod tidy -compat=1.18', and commit your changes"; exit 1)
test -z "$(git status --porcelain)" || (echo "please run 'go mod tidy -compat=1.19', and commit your changes"; exit 1)
- name: Run unit tests
working-directory: ./cmd
run: make test
flow:
strategy:
matrix:
go-version: [1.18, 1.19]
go-version: ["1.19", "1.20"]
runs-on: ubuntu-latest
steps:
- name: Install Go
Expand All @@ -88,15 +88,15 @@ jobs:
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5
with:
working-directory: ./flow
version: v1.50.1
version: v1.51.1
args: --config=../.golangci.yml --verbose --out-${NO_FUTURE}format colored-line-number
skip-cache: true
- name: Check module tidiness
working-directory: ./flow
run: |
go mod tidy -compat=1.18
go mod tidy -compat=1.19
go mod verify
test -z "$(git status --porcelain)" || (echo "please run 'go mod tidy -compat=1.18', and commit your changes"; exit 1)
test -z "$(git status --porcelain)" || (echo "please run 'go mod tidy -compat=1.19', and commit your changes"; exit 1)
- name: Run unit tests
working-directory: ./flow
run: make test
12 changes: 11 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Also https://github.com/cilium/cilium/blob/master/.golangci.yaml as a
# reference.
run:
go: '1.19'
go: '1.20'
linters:
disable-all: true
enable:
Expand All @@ -23,6 +23,7 @@ linters:
- exhaustive
- exportloopref
- forcetypeassert
- gocheckcompilerdirectives
- gocognit
- goconst
- gocritic
Expand All @@ -40,6 +41,7 @@ linters:
- interfacebloat
- makezero
- misspell
- musttag
- nakedret
- nestif
- nilerr
Expand Down Expand Up @@ -79,6 +81,8 @@ linters-settings:
rules:
- name: package-comments
disabled: true
staticcheck:
checks: ["all"]
issues:
# Default rules exclude Go doc comments check, which is rather unfortunate.
# In order to enable Go doc checks, defaults rules have to be disabled.
Expand All @@ -91,3 +95,9 @@ issues:
text: "do not define dynamic errors, use wrapped static errors instead"
- linters: [gosec]
text: "G404" # Use of weak random number generator (math/rand instead of crypto/rand)
# TODO: remove the staticcheck exceptions below once we have switched to
# using crypto/rand instead of math/rand
- linters: [staticcheck]
text: "SA1019: rand.Read has been deprecated since Go 1.20 because it shouldn't be used"
- linters: [staticcheck]
text: "SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0"
2 changes: 1 addition & 1 deletion cmd/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cilium/fake/cmd

go 1.18
go 1.19

require (
github.com/cilium/cilium v1.13.0-rc5
Expand Down
2 changes: 1 addition & 1 deletion flow/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cilium/fake/flow

go 1.18
go 1.19

require (
github.com/cilium/cilium v1.13.0-rc5
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cilium/fake

go 1.18
go 1.19

require github.com/stretchr/testify v1.8.1

Expand Down