From caf10075611f78e42de7876fba80992f4d0e23c8 Mon Sep 17 00:00:00 2001 From: Ayooluwa Isaiah Date: Sat, 5 Oct 2024 18:05:24 +0100 Subject: [PATCH] add golangci-lint workflow --- .github/workflows/golangci-lint.yml | 23 +++++++++++++++++++++++ .golangci.yml | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/golangci-lint.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 0000000..d62c2a5 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,23 @@ +name: Lint code +on: + push: + branches: + - master + pull_request: + +permissions: + contents: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: 1.23 + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: v1.60 diff --git a/.golangci.yml b/.golangci.yml index 14fe3c7..097db64 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,13 +6,13 @@ linters: - decorder - containedctx - contextcheck + - copyloopvar - dogsled - dupl - errcheck - errchkjson - errname - errorlint - - exportloopref - exhaustive - goconst - godot @@ -47,6 +47,7 @@ linters: - usestdlibvars - unparam - unused + - wastedassign - whitespace - wsl