Golang tips

Building for multiple platforms

Check out the source, and from the src directory, run the following loop:

$ for os in linux darwin windows; do for arch in 386 amd64; do echo ===== building $os/$arch =====; sleep 3; GOARCH=$arch GOOS=$os ./make.bash --no-clean 2>&1 ; done ;done

Then, to cross compile:

$ GOARCH=386 GOOS=windows go build maxproc.go

$ file maxproc.exe 
maxproc.exe: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows
en/ressources/astuces/golang.txt · Last modified: 2014/04/25 14:59 (external edit)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0