From b1c10ecce99fe60da826d45eba9239fd136a05e6 Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Thu, 30 Jul 2026 12:52:28 +0800 Subject: [PATCH 1/2] fix(otel): check fmt.Fprint return value in MetricsHandler (closes #271) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit golangci-lint (errcheck) was failing CI on main: internal/otel/metrics.go:205: Error return value of `fmt.Fprint` is not checked Explicitly ignore the write result in the /metrics HTTP handler (`_, _ = fmt.Fprint(...)`) — a best-effort write to the ResponseWriter, matching the handler idiom. This was the sole finding; build, vet, golangci-lint (0 issues) and staticcheck all pass locally now. --- internal/otel/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/otel/metrics.go b/internal/otel/metrics.go index 1690da9..1dd23eb 100644 --- a/internal/otel/metrics.go +++ b/internal/otel/metrics.go @@ -202,7 +202,7 @@ func MetricsHandler(metrics ...*SMTMetrics) http.HandlerFunc { b.WriteString(m.PrometheusText()) } w.Header().Set("Content-Type", "text/plain; version=0.0.4") - fmt.Fprint(w, b.String()) + _, _ = fmt.Fprint(w, b.String()) } } From a9297760a71fa3dd93d0188c14fb8caa88ed74b4 Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Thu, 30 Jul 2026 13:07:37 +0800 Subject: [PATCH 2/2] fix(ci): pin golangci-lint v2.12.2 via action@v8 golangci-lint-action@v6 installs a v1.x binary (v1.64.8, built with go1.24) that (a) cannot parse the v2 .golangci.yml schema and (b) refuses go.mod targeting go1.25.0. Bump to action@v8 with pinned version v2.12.2 to match the org toolchain. Verified locally: build/vet/golangci-lint(0 issues)/staticcheck all green. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0051c3d..578608e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,9 +29,9 @@ jobs: run: go test -short -timeout 300s ./... - name: golangci-lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v8 with: - version: latest + version: v2.12.2 args: --allow-serial-runners --timeout 10m - name: staticcheck