From bdd4a374071587968ee0f64b324fff3de037f4f7 Mon Sep 17 00:00:00 2001 From: Yoshiyuki Mineo Date: Fri, 2 May 2025 01:27:00 +0900 Subject: [PATCH] Introduce golangci-lint --- .github/workflows/test-v1.yml | 19 +++++-------------- .github/workflows/test-v2.yml | 21 ++++++--------------- 2 files changed, 11 insertions(+), 29 deletions(-) diff --git a/.github/workflows/test-v1.yml b/.github/workflows/test-v1.yml index 4953b70..49c325c 100644 --- a/.github/workflows/test-v1.yml +++ b/.github/workflows/test-v1.yml @@ -30,22 +30,13 @@ jobs: with: go-version: ${{matrix.go-version}} - - name: gofmt + - name: Lint Code + uses: golangci/golangci-lint-action@v6 + + - name: Check format run: test -z "`gofmt -l .`" - - name: Install golint - run: go install golang.org/x/lint/golint@latest - - - name: golint - run: test -z "`$(go env GOPATH)/bin/golint ./...`" - - - name: Install staticcheck - run: go install honnef.co/go/tools/cmd/staticcheck@latest - - - name: staticcheck - run: $(go env GOPATH)/bin/staticcheck ./... - - - name: go test + - name: Run tests run: go test -v ./... - name: Build example diff --git a/.github/workflows/test-v2.yml b/.github/workflows/test-v2.yml index 3e2ed7e..8ba1e01 100644 --- a/.github/workflows/test-v2.yml +++ b/.github/workflows/test-v2.yml @@ -33,23 +33,14 @@ jobs: - name: Tidy modules run: go mod tidy + - name: Lint Code + uses: golangci/golangci-lint-action@v6 + + - name: Check format + run: test -z "`gofmt -l .`" + - name: Run tests run: go test ./... -v - - name: gofmt - run: test -z "`gofmt -l .`" - - - name: Install golint - run: go install golang.org/x/lint/golint@latest - - - name: golint - run: test -z "`$(go env GOPATH)/bin/golint ./...`" - - - name: Install staticcheck - run: go install honnef.co/go/tools/cmd/staticcheck@latest - - - name: staticcheck - run: $(go env GOPATH)/bin/staticcheck ./... - - name: Build example run: cd example && ./linux64_build.sh