refactor: link internal/buildcfg.ToolTags and enhance demo test coverage
- Link internal/buildcfg.ToolTags variable instead of hardcoding tool tags - Add comprehensive test cases in demo.go to verify: - build.Default.Compiler is correctly patched to "gc" - ToolTags are properly populated from internal/buildcfg - ReleaseTags are correctly generated - Validates the go/build patches work as expected 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,23 @@ import (
|
||||
|
||||
func main() {
|
||||
fmt.Printf("runtime.Compiler = %q\n", runtime.Compiler)
|
||||
|
||||
ctx := build.Default
|
||||
fmt.Printf("build.Default.Compiler = %q\n", ctx.Compiler)
|
||||
if ctx.Compiler != "gc" {
|
||||
panic(fmt.Sprintf("expected build.Default.Compiler to be \"gc\", got %q", ctx.Compiler))
|
||||
}
|
||||
|
||||
if len(ctx.ToolTags) == 0 {
|
||||
panic("expected build.Default.ToolTags to be non-empty")
|
||||
}
|
||||
fmt.Printf("build.Default.ToolTags = %v\n", ctx.ToolTags)
|
||||
|
||||
if len(ctx.ReleaseTags) == 0 {
|
||||
panic("expected build.Default.ReleaseTags to be non-empty")
|
||||
}
|
||||
fmt.Printf("build.Default.ReleaseTags count = %d\n", len(ctx.ReleaseTags))
|
||||
|
||||
pkg, err := build.Import("fmt", "", build.FindOnly)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
Reference in New Issue
Block a user