3 ms·
It's not that simple. The Go compiler uses a main package as its entry point when compiling a binary. A module can have a many main packages each using differen
by icholy 3y ago
It's not that simple. The Go compiler uses a main package as its entry point when compiling a binary. A module can have a many main packages each using different subsets of the library packages.
So there are two choices here:
1. The Go compiler complains about code which is unused by the current main package.
2. The Go compiler tries to find/compile all main packages every-time.
Both of these options suck.