From f1770d2d19bd694155cd2cbe776c5758e81251d1 Mon Sep 17 00:00:00 2001 From: Hugo Haas Date: Sat, 15 Feb 2025 19:38:19 -0600 Subject: [PATCH 1/4] golangci-lint fix test -f $(go env GOPATH)/bin/golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.5 $(go env GOPATH)/bin/golangci-lint run ./... WARN The linter 'tenv' is deprecated (since v1.64.0) due to: Duplicate feature another linter. Replaced by usetesting. pkg/testcoverage/badgestorer/github_test.go:92:3: context.Background() could be replaced by t.Context() in deleteFile (usetesting) context.Background(), ^ pkg/testcoverage/badgestorer/github_test.go:101:3: context.Background() could be replaced by t.Context() in deleteFile (usetesting) context.Background(), ^ make: *** [lint] Error 1 zsh: exit 2 make lint --- pkg/testcoverage/badgestorer/github_test.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/testcoverage/badgestorer/github_test.go b/pkg/testcoverage/badgestorer/github_test.go index f131b4ed..782cc0c9 100644 --- a/pkg/testcoverage/badgestorer/github_test.go +++ b/pkg/testcoverage/badgestorer/github_test.go @@ -1,7 +1,6 @@ package badgestorer_test import ( - "context" crand "crypto/rand" "encoding/hex" "fmt" @@ -89,7 +88,7 @@ func deleteFile(t *testing.T, cfg Git) { client := github.NewClient(nil).WithAuthToken(cfg.Token) fc, _, _, err := client.Repositories.GetContents( - context.Background(), + t.Context(), cfg.Owner, cfg.Repository, cfg.FileName, @@ -98,7 +97,7 @@ func deleteFile(t *testing.T, cfg Git) { assert.NoError(t, err) _, _, err = client.Repositories.DeleteFile( - context.Background(), + t.Context(), cfg.Owner, cfg.Repository, cfg.FileName, From 63ee5bac247448f7293334569ab0b38defba6bc7 Mon Sep 17 00:00:00 2001 From: Hugo Haas Date: Sat, 15 Feb 2025 19:38:30 -0600 Subject: [PATCH 2/4] Update to Go 1.24.0 --- Dockerfile | 4 ++-- Makefile | 6 +++--- go.mod | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 556973c3..68194039 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # GO_VERSION: go version should match version in go.mod file -FROM golang:1.23 as builder +FROM golang:1.24 as builder WORKDIR /workspace COPY go.mod go.mod @@ -18,4 +18,4 @@ WORKDIR / COPY --from=builder /workspace/go-test-coverage . COPY --from=builder /usr/local/go/bin/go /usr/local/go/bin/go ENV PATH="${PATH}:/usr/local/go/bin" -ENTRYPOINT ["/go-test-coverage"] \ No newline at end of file +ENTRYPOINT ["/go-test-coverage"] diff --git a/Makefile b/Makefile index 07574d74..3b013f98 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ GO ?= go GOBIN ?= $$($(GO) env GOPATH)/bin GOLANGCI_LINT ?= $(GOBIN)/golangci-lint -GOLANGCI_LINT_VERSION ?= v1.63.4 +GOLANGCI_LINT_VERSION ?= v1.64.5 # Code tidy .PHONY: tidy @@ -20,7 +20,7 @@ lint: get-golangcilint # Runs tests on entire repo .PHONY: test -test: +test: go test -timeout=3s -race -count=10 -failfast -shuffle=on -short ./... go test -timeout=20s -race -count=1 -failfast -shuffle=on ./... -coverprofile=./cover.profile -covermode=atomic -coverpkg=./... @@ -33,4 +33,4 @@ check-coverage: test .PHONY: view-coverage view-coverage: go tool cover -html=cover.profile -o=cover.html - xdg-open cover.html \ No newline at end of file + xdg-open cover.html diff --git a/go.mod b/go.mod index 611039b6..da7597ad 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/vladopajic/go-test-coverage/v2 // GO_VERSION: when changing go version update version in other places -go 1.23 +go 1.24 -toolchain go1.23.4 +toolchain go1.24.0 require ( github.com/alexflint/go-arg v1.4.3 From cc1a24b0d217953ac622c81684e9a6318468e76f Mon Sep 17 00:00:00 2001 From: Hugo Haas Date: Wed, 19 Feb 2025 18:05:30 -0600 Subject: [PATCH 3/4] Bumped golangci-lint to v1.64.5 --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 02ecfc16..52c5c926 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,6 +16,6 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: v1.63.4 + version: v1.64.5 - id: govulncheck uses: golang/govulncheck-action@v1 From 31a1189b36bd41487656f1595de69b5745b116be Mon Sep 17 00:00:00 2001 From: Hugo Haas Date: Wed, 19 Feb 2025 18:13:17 -0600 Subject: [PATCH 4/4] Added back LINT_VERSION comments from main branch --- .github/workflows/lint.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 52c5c926..4e2549c6 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,6 +16,6 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: v1.64.5 + version: v1.64.5 # LINT_VERSION: update version in other places - id: govulncheck uses: golang/govulncheck-action@v1 diff --git a/Makefile b/Makefile index 3b013f98..2d0bf539 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ GO ?= go GOBIN ?= $$($(GO) env GOPATH)/bin GOLANGCI_LINT ?= $(GOBIN)/golangci-lint -GOLANGCI_LINT_VERSION ?= v1.64.5 +GOLANGCI_LINT_VERSION ?= v1.64.5 # LINT_VERSION: update version in other places # Code tidy .PHONY: tidy