Add golangci-lint and update code based on ci result #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Lint | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "**/*.go" | |
- ".github/workflows/golangci.lint.yml" | |
env: | |
GO_VERSION: "1.20" | |
jobs: | |
analysis: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.54 | |
# no errcheck, and no check for deprecated code. | |
# since some deprecated code is used in the project and no perfect replacement is available yet. | |
args: --timeout=30m --disable=errcheck --exclude=SA1019 |