Skip to content

Commit

Permalink
Fix lint: upgrade to support go1.22
Browse files Browse the repository at this point in the history
golangci-lint supports go1.22 since v1.56.0, per golangci/golangci-lint#4273.

Switch to using Github Actions for lint check.
  • Loading branch information
jkh52 committed Oct 4, 2024
1 parent 78f31c9 commit 35153e7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
run:
timeout: 3m
timeout: 5m
skip-dirs:
- vendor
linters:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 35153e7

Please sign in to comment.