Cross-Compiling Your Application
Unlike interpreted languages such as Python or Nodejs, Go is a compiled language, which means it produces a binary executable file that contains all the requirements to run your application.
When you’re planning to distribute your application, this is a major benefit as users can run your application by running the binary executable without having to install any interpreters or runtimes. This makes Go applications extremely portable.
When building the executable file, Go creates a file that contains instructions that are specific for a target operating system and architecture. Because of this, you can’t take a file that is compiled for Linux and try to run it on Windows, or a file that was compiled for the Linux ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access