Skip to content

Commit 48f5aa9

Browse files
committed
fix: clear remaining staticcheck + go mod tidy findings
Static Analysis findings (all real, all fixed in place): - filter/warmup.go: rename receiver pc→p to match the other 33 methods on PipelineCoordinator (ST1016) - simd/simd.go:207: bytes.Index(x, y) >= 0 → bytes.Contains(x, y) (S1003) - logging/logger_test.go:31: context.WithValue with string key → define a local ctxKey string type (SA1029 — prevents cross-package key collisions; the whole point of that lint) go mod tidy: go.mod + go.sum had drifted. Lint 'Check go mod tidy' diff- checks after tidying, which was failing on stale indirect entries. Coverage, Import Check, Benchmark passed in the previous run; remaining failures all from the Static Analysis + go-mod-tidy steps.
1 parent 4ff635c commit 48f5aa9

5 files changed

Lines changed: 7 additions & 8 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.sum

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/filter/warmup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package filter
33
import "sync/atomic"
44

55
// Warmup pre-initializes pipeline components
6-
func (pc *PipelineCoordinator) Warmup() {
6+
func (p *PipelineCoordinator) Warmup() {
77
dummy := "warmup test data"
8-
pc.Process(dummy)
8+
p.Process(dummy)
99
}
1010

1111
// LockFreeCounter atomic counter

internal/logging/logger_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ func TestLogger_WithContext(t *testing.T) {
2727
t.Error("expected non-nil logger")
2828
}
2929

30-
// Test with trace ID
31-
ctx = context.WithValue(context.Background(), "trace_id", "abc-123")
30+
// Test with trace ID (typed key per SA1029)
31+
type ctxKey string
32+
ctx = context.WithValue(context.Background(), ctxKey("trace_id"), "abc-123")
3233
newLogger = logger.WithContext(ctx)
3334
if newLogger == nil {
3435
t.Error("expected non-nil logger with trace_id")

internal/simd/simd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func FastContains(s, substr string) bool {
204204

205205
// For small patterns, use bytes.Index
206206
if len(substr) <= 16 {
207-
return bytes.Index([]byte(s), []byte(substr)) >= 0
207+
return bytes.Contains([]byte(s), []byte(substr))
208208
}
209209
return strings.Contains(s, substr)
210210
}

0 commit comments

Comments
 (0)