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 16:59 (external edit)
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0