From f12cdd5a73be17dc45114c58a56788ad8c02884f Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Sun, 1 Dec 2024 15:36:35 +0200 Subject: [PATCH] Update Go version in GitHub Actions workflow --- .github/workflows/test_and_lint.yaml | 28 ++++++++-------------------- plugin/main.go | 3 ++- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test_and_lint.yaml b/.github/workflows/test_and_lint.yaml index 6cc83d7..4eca491 100644 --- a/.github/workflows/test_and_lint.yaml +++ b/.github/workflows/test_and_lint.yaml @@ -10,25 +10,13 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.14 - uses: actions/setup-go@v1 - with: - go-version: 1.14 - id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Restore cache - uses: actions/cache@v1 + - name: Set up Go + uses: actions/setup-go@v5 with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Get dependencies - run: | - go mod download + go-version: 1.23 - name: Test run: go test @@ -37,9 +25,9 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v6 with: - version: v1.29 - args: --disable-all --enable=goimports --enable=golint --enable=govet + version: v1.62.2 + args: '--disable-all --enable=goimports --enable=govet --exclude "printf: non-constant format string"' diff --git a/plugin/main.go b/plugin/main.go index 79e6cf6..4b17ca3 100644 --- a/plugin/main.go +++ b/plugin/main.go @@ -13,7 +13,8 @@ import ( // flags for Analyzer.Flag. // If you would like to specify flags for your plugin, you can put them via 'ldflags' as below. -// $ go build -buildmode=plugin -ldflags "-X 'main.flags=-opt val'" github.com/sanposhiho/wastedassign/plugin/wastedassign +// +// $ go build -buildmode=plugin -ldflags "-X 'main.flags=-opt val'" github.com/sanposhiho/wastedassign/plugin/wastedassign var flags string // AnalyzerPlugin provides analyzers as a plugin.