In go 1.4, you need to build the go tools for a given target beforehand. In go 1.5, you'll only have to set some environment variables before you call go build, that's it, but unfortunately this doesn't include cgo:
env GOOS=linux GOARCH=arm GOARM=7 go build hello.go
This link is a good summary of the situation now and in future:
Comments
In go 1.4, you need to build the go tools for a given target beforehand. In go 1.5, you'll only have to set some environment variables before you call go build, that's it, but unfortunately this doesn't include cgo:
This link is a good summary of the situation now and in future:http://dave.cheney.net/2015/03/03/cross-compilation-just-got...
This one talks about cgo:
https://medium.com/@rakyll/go-1-5-cross-compilation-488092ba...