February 2019
Intermediate to advanced
450 pages
11h 59m
English
Due to the dependency on CGo, compiling for a platform other than the one you are developing in is, unfortunately, not as simple as setting the GOOS environment variable. Building for a different platform requires an installation of the C compiler for the target operating system. If you've been working through the previous chapters, then this may already be set up, but if not, then the process is documented in Appendix 2, Cross-Compiler Setup.
Once you have the appropriate compiler installed, then the build process is configured by setting the GOOS, CGO_ENABLED, and CC environment variables. You may also need to update your path—it's advisable to put this in your Terminal or shell configuration:
Read now
Unlock full access