Go programs can run anywhere, but you’ve got to create builds specific to
each operating system and architecture. This can be done when building by
GOARCH environment variables.
For example, if you’d like to build a 32-bit Linux distribution:
GOOS=linux GOARCH=386 go build -o linux_386_build
GOOS value specifies the operating system as Linux and the
386 specifies a 32-bit architecture.
The plethora of
GOARCH options can be found