by geodel · 10y ago · 0 comments
If you use `CGO_ENABLED=0 go build`, it should make a statically linked executable.
I should also check how Windows with Bonjour behaves.
Search for systemConf().canUseCgo()
https://github.com/golang/go/blob/master/src/net/lookup_unix...
Otherwise it will dynamically link glibc in case of CGO code.
Note: the race detector does not work without cgo enabled.
go install -tags=netgo github.com/google/git-appraise/git-appraise env CGO_ENABLED=0 go get github.com/google/git-appraise/git-appraise
but I always get an error that go wants to write net.a in /usr/lib, which I naturally am not allowed to do because it's owned by the distro (Arch) go package: go install net: open /usr/lib/go/pkg/linux_amd64/net.a: permission denied
I have only set GOPATH to ~/.go and nothing else. Any other GO environment variable I should have used?