Re:Deadcode: Finding unreachable functions in Go
by icholy on Tuesday January 23, 2024 @03:14PM
(#39109102)
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.
So there are two choices here:
Both of these options suck.