fix(otel): check fmt.Fprint return value in MetricsHandler (closes #271) - #283
Merged
Conversation
added 2 commits
July 30, 2026 12:52
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #271.
CI on
mainwas red — thegolangci-lintstep failed on a singleerrcheckfinding:Explicitly ignore the write result in the
/metricsHTTP handler (_, _ = fmt.Fprint(...)) — a best-effort write to theResponseWriter, matching the handler idiom.Build, vet,
golangci-lint(0 issues), andstaticcheck -checks allall pass locally after the fix. This was the sole blocker keeping main CI red.