Golang supports several execution modes that determine how code is built and linked. The main modes are:
- exe: Default for main packages, builds everything into a single executable.
- shared: Combines packages into a shared library for dynamic linking, reducing binary size. Currently only supported on Linux.
- archive: Default for non-main packages, builds into a .a library file.
- c-shared/c-archive: Builds packages into a single C shared library/archive file for calling from C/C++.
- plugin: Builds packages into a shared library that can be dynamically loaded at runtime, similar to dlopen. Currently only supported on Linux.