$ the-wire · showcase
cgo gains //cgo:var pragmas, simd hides experimental deps behind unexported duplicates
By RepoJournal · Filed · About Go · Composed from the cited sources · methodology
The cgo binding and rewrite paths got a new pragma and a go/types-based scope resolver, while the simd package worked around its own experimental methods leaking into generally available emulations.
cmd/cgo: support //cgo:var pragmas for C global variables in bindings golang/go
cmd/cgo now accepts //cgo:var GoName [C.]cName {"lib" | static | libc}, which names an unexported package-level variable with an explicit type and no initializer; the tool then removes that declaration and rewrites uses to dereference a pointer to the C global, reached through a dynamic import or, for static, a link-time reference to a .syso or .a file. This is new surface for binding generator...
cmd/cgo: use shared Package.fset and go/types in binding processing golang/go
Binding processing now parses a package's Go files into a shared Package.fset rather than per-file FileSets, resolving lexical scopes with go/types and a stub importer that ignores external imports and type errors, so a local declaration named C is no longer mistaken for the C pseudo-package. Bound declarations are stripped from the AST before rewriting.
simd/archsimd: implement wasm IfElse with unexported bitSelect golang/go
IfElse is generally available, but on wasm it was implemented with BitSelect, which is experimental; aclements added an unexported bitSelect duplicate of each BitSelect method and rebuilt IfElse on top of it, the same pattern SaturateTo emulations use with concatSaturateTo. The commit describes the duplicate as temporary, so expect it to disappear once the underlying methods graduate.
simd/archsimd: use an unexported concatPermute128Scalars internally golang/go
ConcatPermute128Scalars stays experimental, but the tmplgen-generated HiToLo emulations on 256-bit vectors and the emulated LookupOrZero on Int8x32 and Int8x64 depend on it, so an unexported concatPermute128Scalars now backs those paths instead. Same shape of fix as the wasm IfElse change: keep the public API from depending on unshipped methods.
internal/breakings: fix value-to-pointer receiver method changes golang/pkgsite
pkgsite's breakings analyzer now upgrades a value-receiver method to ChangeBreaking when it both moves to a pointer receiver and changes signature in a call-compatible way, instead of reporting ChangeCallCompatible; it also tracks seen method names so removed or changed value methods are not yielded twice. Elsewhere on the desk: API.Doc returns doc comments for packages and symbols, and a year-...