From 4abbab59afed0be7083da2c300486fc3d0283dd7 Mon Sep 17 00:00:00 2001 From: Julian Sommer <115516918+juliansommer@users.noreply.github.com> Date: Tue, 1 Sep 2026 11:48:30 +1000 Subject: [PATCH] fix: drop NeedDeps from the slog duration guard's package load The guard only reads types for the syntax it walks, which resolves from dependency export data; NeedDeps type-checked the whole graph from source for no extra coverage. Verified identical detection either way (160 packages, 993 files, 3684 slog call sites, and both violation classes still caught). 19.0s to 7.3s under -race. --- spinifex/otelsetup/duration_guard_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spinifex/otelsetup/duration_guard_test.go b/spinifex/otelsetup/duration_guard_test.go index b416a8404..b611f69d5 100644 --- a/spinifex/otelsetup/duration_guard_test.go +++ b/spinifex/otelsetup/duration_guard_test.go @@ -33,9 +33,12 @@ var logMethods = map[string]bool{ func TestSlogDurationConvention(t *testing.T) { root := moduleRoot(t) + // No NeedDeps: the guard only reads types for the syntax it walks, which + // resolves from dependency export data. Asking for dependency syntax as + // well type-checks the whole graph from source for no extra coverage. cfg := &packages.Config{ Mode: packages.NeedName | packages.NeedSyntax | packages.NeedTypes | - packages.NeedTypesInfo | packages.NeedDeps | packages.NeedImports, + packages.NeedTypesInfo | packages.NeedImports, Dir: root, } pkgs, err := packages.Load(cfg, "./spinifex/...", "./cmd/...")