Files
llgo/_demo/go/gobuild/demo.go
xgopilot 224e3b9440 fix: add Go 1.23+ build constraint to gobuild demo
Add //go:build go1.23 constraint to skip compilation on Go 1.21/1.22
where runtime.(*Func).Name is not implemented in llgo, causing linker
errors when internal/bisect is pulled in as a dependency.

The demo works correctly on Go 1.23+ where the dependency chain or
internal/bisect behavior avoids calling the unimplemented method.

Fixes compatibility issue reported in PR review.

🤖 Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: luoliwoshang <luoliwoshang@users.noreply.github.com>
2025-10-16 03:14:32 +00:00

20 lines
330 B
Go

//go:build go1.23
package main
import (
"fmt"
"go/build"
"runtime"
)
func main() {
fmt.Printf("runtime.Compiler = %q\n", runtime.Compiler)
pkg, err := build.Import("fmt", "", build.FindOnly)
if err != nil {
panic(err)
}
fmt.Printf("Package: %s\n", pkg.ImportPath)
fmt.Printf("Success! go/build works with llgo\n")
}