$ the-wire · showcase
Overflowing constants invalidated, cgo's `any` rewrite reverted
By RepoJournal · Filed · About Go · Composed from the cited sources · methodology
Today's Go changes are correctness fixes: the type checker stops panicking on overflowed constants, cgo keeps emitting `interface{}`, and a pkgsite regression that broke `go doc -http` is rolled back.
go/types, types2: invalidate overflowing constants golang/go
go/types and types2 previously left an operand valid after reporting integer or string constant overflow, or an unrepresentable constant result, so a later assignment to unsafe.Pointer could trip an assertion while recording the constant's type and value. The operand is now invalidated in all three cases, and representableConst rejects non-constant types before accepting unknown constant values...
Revert "cmd/internal/doc: allow reading packages from module cache" golang/pkgsite
The change that let cmd/internal/doc read packages from the module cache is reverted: it cancelled pkgsite.BuildServer's Paths default, so no local getter was built and packages in the local workspace stopped loading. That broke both `go doc -http` and `go doc -http <stdlib_package>`.
Revert "cmd/cgo: emit any instead of interface{} in generated files" golang/go
Robert Griesemer reverted the cmd/cgo change that emitted `any` instead of `interface{}` in generated files, restoring the older output. Generated cgo code that you check in or diff against will go back to `interface{}`.
internal/astutil: drop Directive in favor of go1.26's ast.Directive golang/tools
internal/astutil no longer carries its own Directive type: golang/tools now uses ast.Directive from go1.26, part of the effort tracked in golang/go#68021. If you use astutil.Directive, that is a breaking removal.
go/packages, gopls: do not treat non-go files as Go packages golang/tools
go/packages no longer synthesizes an ad-hoc package from files without a .go extension, and gopls's Snapshot.FileKind stops defaulting unrecognized extensions to file.Go. Non-Go files passed to a file= query now stay non-Go.
go/types, types2: improve TestScopeNoAllocations golang/go
go/types and types2 tests also got two smaller repairs: TestScopeNoAllocations now iterates directly because Scope.Objects is allocation-free only when it inlines, and scope_test.go was added to the generator's file map so the -write=all claim holds. golang/arch x86asm gained BMI1 and BMI2 decoding, and compilebench now exits 1 when a benchmark fails.