go-patch-overlay
go-patch-overlay copied to clipboard
Compile failed.
In ./example/goroutineid foler. Execute go1.16 build -overlay="$(../../go-patch-overlay ./patches)"
go1.16 build -overlay="$(../../go-patch-overlay ./patches)"
# github.com/felixge/go-patch-overlay/example/goroutineid
./main.go:17:21: undefined: runtime.Getgid
./main.go:20:22: undefined: runtime.Getgid
./main.go:24:22: undefined: runtime.Getgid
./main.go:28:22: undefined: runtime.Getgid
How should I fix it?
@tutumagi hm, I can't reproduce this issue locally. Can you run this and share the output you get?
cat "$(../../go-patch-overlay ./patches)"
$ ../../go-patch-overlay ./patches
/var/folders/sl/jm36v99n2yj1w02tlvmnzdc80000gn/T/go-patch-overlay007724818/overlay.json
$ ../../go-patch-overlay ./patches /var/folders/sl/jm36v99n2yj1w02tlvmnzdc80000gn/T/go-patch-overlay007724818/overlay.json
the json file' content is:
{
"Replace": {
"/usr/local/go/src/runtime/stubs.go": "/var/folders/sl/jm36v99n2yj1w02tlvmnzdc80000gn/T/go-patch-overlay007724818/src/runtime/stubs.go"
}
}
What does go1.16 env GOROOT give you? Did you compile ../../go-patch-overlay with the same go1.16 binary? If not, that's probably the cause of this issue.