Files
signoz/pkg/http
Tushar Vats 302a40e8df chore(lint): satisfy golangci-lint v2.12.2 and de-flake http middleware tests (#12383)
primus bumped golangci-lint to v2.12.2, whose govet now runs the inline
analyzer and whose sloglint is stricter. CI resolves primus.workflows@main,
so every PR started failing lint the moment that landed.

- reflect.Ptr is a deprecated alias carrying //go:fix inline, so it is now
  reflect.Pointer at all five call sites
- metricsstatementbuilder imported golang.org/x/exp/slices, which carries
  //go:fix inline pointing at the stdlib; the analyzer cannot inline
  generics, so switch the import to stdlib slices as the directive intends
- pkg/instrumentation/loghandler emits OpenTelemetry semantic-convention
  attributes (code.filepath, exception.type, ...), which are dotted rather
  than snake_case by definition. Renaming them would break every log
  consumer, so the keys move to constants in instrumentationtypes, which
  already held this kind of key -- and already defined code.function, so
  source.go was duplicating it. Six of the seven alias the semconv
  constants that define them; exception.code has no OTel equivalent.
  sloglint resolves a same-package constant back to its literal but skips
  a qualified one, so this needs no exclusion.

CI reported 8 issues but capped at max-same-issues=3, hiding 2 more
reflect.Ptr sites and 4 more sloglint ones.

Separately, TestTimeout/WaitTillNoTimeoutForExcludedPath failed with
"transport connection broken: http: CloseIdleConnections called".
TestTimeout and TestCache issue requests through http.DefaultClient while
a parallel subtest in response_test.go closes an httptest.Server, and
httptest.Server.Close calls http.DefaultTransport.CloseIdleConnections.
Both tests now use their own client and transport, and are closed via
t.Cleanup. That makes Serve return ErrServerClosed on every run, so the
require.NoError wrapping it is dropped -- it could never have held, and
require runs t.FailNow off the test goroutine anyway. Bare Serve in a
goroutine matches routerweb and render tests.
2026-08-03 14:41:16 +00:00
..