Repository navigation
Module path stays github.com/kidandcat/gox (as in v0.5.1). Rules are
stricter than v0.5.x; to adopt v0.6.0 on an existing codebase, run
gox baseline once and commit .gox-baseline.json.
Changed
-
Minimum Go is 1.26.8. Go 1.25 is out of support, and
go 1.25.5(the
previousgoline) ships a standard library affected by GO-2026-4602.
go installnow needs a toolchain that old. -
gox check --jsonprints one JSON object (issues,issue_count,
hidden,load_errors) on stdout. Exit codes are unchanged. The same
--max-issuescap applies. -
gox cache cleandeletes the on-disk cache, including older version
directories. -
exhaustivechecks iota enums declared in other packages of the same
module (the usualmodel.Kindswitched inservice/). Enums from the
standard library and from third-party modules are still ignored. Constants
that share a value (const Default = Off) count as one variant. -
namedargsno longer treats a dotless module (module myapp) as the
standard library. Stdlib exemption usesgo list'sStandardfield. -
httptimeoutflagshttp.ListenAndServe,ListenAndServeTLS,Serve,
andServeTLS. -
errchecktreats a result as an error only when it implementserror
(Error() string), including concrete types such as*ValidationError.
An interface method that is merely namedErroris no longer enough. -
contextchecktreats a function literal that receives its own
context.Contextas a root, soerrgroup.Go(func(ctx context.Context) error { context.Background() })
is reported. -
A package
go listaccepts butgo/typesdoes not is now a load error
(exit 2) and its partial result is not cached. -
gox check/gox baselineresolve the module root from the first
filesystem pattern, not only from the current directory. -
Breaking — exit code:
gox checknow fails closed when a package
cannot be loaded (syntax error, type error, missing dependency). Such
packages used to be printed to stderr and skipped, and the run exited0
if nothing else was found. It now exits2and reports
gox: N package(s) failed to load or type-check; the report is incomplete; any issues found
are still printed.gox baselinerefuses to write an incomplete snapshot
in that case. Scripts or CI that relied on exit0for non-compiling code
will now fail. (#4) -
The cache key now also covers the export data of every dependency and a
fingerprint of the gox binary. Results are no longer stale after a
dependency's API changes or after gox is upgraded or rebuilt. The cache
directory moved fromgox/v3togox/v4.
(#5)
Fixed
bodyclosematchesresp.Body.Close()bytypes.Object. A shadowed
respin an inner block no longer counts as closing the outer response.errorlintunderstands explicit argument indexes (%[1]v) and*width
or precision, which consumes an operand. String-literal escapes are
unquoted before the format is read.- The Stop hook sanitizes
session_idbefore using it as a cache filename. - Generated files are detected with
ast.IsGenerated(the exact Go
convention): markers after headers longer than 20 lines are recognized,
and markers placed after thepackageclause no longer hide hand-written
code. (#6) forcetypeassert:var x, ok = v.(T)is accepted as comma-ok.
(#2)bodyclose: leaks inside closures are reported once instead of twice, and
a response returned to the caller (return resp, err) is no longer
flagged. (#3)gox install claude|grokkeeps the existing permissions of the settings
file instead of rewriting it as0644. It also warns whenjq(required
by the hook) is missing, and the hook says so on stderr instead of doing
nothing silently. (#8)
Internal
- Packages from one
go listshare a single export-data importer, so the
standard library is decoded once and type identity stays intact. Internal
test variants no longer re-walk production files, and baseline
fingerprints read each source file once. - Opt-out comments are indexed once per file.
goroutine,banany,
noglobals, andexhaustiveuse that index, so a comment group that
ends on the flagged line suppresses the finding the same way
safe-ignorealready did. pkg/analyzer,pkg/loader,pkg/cache, andpkg/baselineare
implementation packages. They are not a stable API.- CI:
gofmt,go vet,go test -race,staticcheckandgovulncheck
run on the minimum toolchain plus current stable. Also removed dead code
(entryHasGoxCommand) and fixed gofmt drift.
(#7) - CLI tests cover the fail-closed path:
gox checkexits2and
gox baselinewrites nothing when a package does not load (including a
replacethat points at a missing directory). - An end-to-end golden test over
testdata/badexercises the full pipeline,
and the stalecallsSwapOKexample was fixed.
(#9) - Docs:
gox baselineand the remainingcheckflags are documented, the
safe-ignorecoverage list is complete, and stale package comments were
fixed. (#10)