feat: add go:linkname directives for defaultToolTags and defaultReleaseTags

Add linkname directives and stdlib comments for defaultToolTags and
defaultReleaseTags variables to match Go standard library pattern. This
allows external packages (like gopherjs) to access these internal variables
via linkname, maintaining compatibility with packages that depend on this
behavior.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
xgopilot
2025-10-16 07:37:13 +00:00
parent 8ac7ada7f9
commit e96625cf07

View File

@@ -41,7 +41,26 @@ func parseGoVersion() int {
var goVersion = parseGoVersion() var goVersion = parseGoVersion()
// defaultToolTags should be an internal detail,
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
// - github.com/gopherjs/gopherjs
//
// Do not remove or change the type signature.
// See go.dev/issue/67401.
//
//go:linkname defaultToolTags
var defaultToolTags []string var defaultToolTags []string
// defaultReleaseTags should be an internal detail,
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
// - github.com/gopherjs/gopherjs
//
// Do not remove or change the type signature.
// See go.dev/issue/67401.
//
//go:linkname defaultReleaseTags
var defaultReleaseTags []string var defaultReleaseTags []string
// defaultContext returns the default Context for builds. // defaultContext returns the default Context for builds.