Go on a Raspberry Pi
Go on a Raspberry Pi
Recently I found myself playing with both Go and a Raspberry Pi. I’ve build a some Go programs on my Mac but copying over the executable to the Pi did not work (surprise!). It is actually fairly easy to crosscompile a Go binary:
GOARM=5 GOARCH=arm GOOS=linux go build your_program.go
It’s all pretty self explanatory, the one thing that confused me was the
GOARM
variable. I’d expect the GOARCH
to be enough. But apparently
there are different ARM types out there. A full list can be found on the
Go site under Optional Environment
Variables.