From 5e0f28d9ce8206302a84453a2719e9e5f892e986 Mon Sep 17 00:00:00 2001 From: santhana krishnan <29514440+hashkrish@users.noreply.github.com> Date: Mon, 19 Oct 2026 22:55:18 +0530 Subject: [PATCH] Fix CI lint: upgrade to golangci-lint v2 golangci-lint-action@v6 with version: latest installed golangci-lint v1.64.8, built with go1.24, which refuses to lint a go 1.25.5 module and cannot read the v2 config. Pin golangci-lint-action@v9 to golangci-lint v2.14.0, restore version: "2" in .golangci.yml (reverting 656e268's go: '1.24' workaround), and fix the two issues the working linter reports (unchecked Close in cloudbuild, unnecessary conversion in artifactregistry). --- .github/workflows/test.yml | 4 ++-- .golangci.yml | 3 +-- internal/services/artifactregistry/service.go | 2 +- internal/services/cloudbuild/api.go | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fbb113a..ccffc02 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,6 +36,6 @@ jobs: with: go-version-file: go.mod - - uses: golangci/golangci-lint-action@v6 + - uses: golangci/golangci-lint-action@v9 with: - version: latest + version: v2.14.0 diff --git a/.golangci.yml b/.golangci.yml index dad8ec3..23c1e56 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,4 @@ -run: - go: '1.24' +version: "2" linters: enable: diff --git a/internal/services/artifactregistry/service.go b/internal/services/artifactregistry/service.go index abae75f..cd24502 100644 --- a/internal/services/artifactregistry/service.go +++ b/internal/services/artifactregistry/service.go @@ -1003,7 +1003,7 @@ func (s *Service) renderDetailView() string { if s.selectedItem.CleanupPolicyCount > 0 { var builder strings.Builder builder.Grow(32) - builder.WriteString(strconv.Itoa(int(s.selectedItem.CleanupPolicyCount))) + builder.WriteString(strconv.Itoa(s.selectedItem.CleanupPolicyCount)) builder.WriteString(" policies") if s.selectedItem.CleanupPolicyDryRun { builder.WriteString(" (dry run)") diff --git a/internal/services/cloudbuild/api.go b/internal/services/cloudbuild/api.go index e8854f9..9220965 100644 --- a/internal/services/cloudbuild/api.go +++ b/internal/services/cloudbuild/api.go @@ -195,7 +195,7 @@ func (c *Client) FetchBuildLogTail(ctx context.Context, logsBucket, buildID stri if err != nil { return "", offset, fmt.Errorf("read build log: %w", err) } - defer r.Close() + defer func() { _ = r.Close() }() data, err := io.ReadAll(r) if err != nil {