From 35153e7fbe57c18403c7ad16a50b3c8455f018a6 Mon Sep 17 00:00:00 2001 From: Joseph Anttila Hall Date: Wed, 2 Oct 2024 21:49:59 -0700 Subject: [PATCH] Fix lint: upgrade to support go1.22 golangci-lint supports go1.22 since v1.56.0, per https://github.com/golangci/golangci-lint/issues/4273. Switch to using Github Actions for lint check. --- .github/workflows/golangci-lint.yaml | 29 ++++++++++++++++++++++++++++ .golangci.yaml | 2 +- Makefile | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/golangci-lint.yaml diff --git a/.github/workflows/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml new file mode 100644 index 000000000..b4a49a5fb --- /dev/null +++ b/.github/workflows/golangci-lint.yaml @@ -0,0 +1,29 @@ +name: golangci-lint +on: + push: + branches: + - master + - release-0.31 + pull_request: + +permissions: + contents: read + +env: + GO_VERSION: v1.22 + GOLANGCI_LINT_VERSION: v1.56 + +jobs: + golangci: + name: lint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: ${{ env.GOLANGCI_LINT_VERSION }} + args: --verbose diff --git a/.golangci.yaml b/.golangci.yaml index 8311ea5df..4e6eb506d 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,5 +1,5 @@ run: - timeout: 3m + timeout: 5m skip-dirs: - vendor linters: diff --git a/Makefile b/Makefile index 222457b93..721af6e3f 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ endif GOOS ?= $(shell go env GOOS) GOARCH ?= $(shell go env GOARCH) INSTALL_LOCATION:=$(shell go env GOPATH)/bin -GOLANGCI_LINT_VERSION ?= 1.54.0 +GOLANGCI_LINT_VERSION ?= 1.56.2 GOSEC_VERSION ?= 2.13.1 REGISTRY ?= gcr.io/$(shell gcloud config get-value project)