go-binary-size
Installation
SKILL.md
Go Binary Size
A stock Go binary carries the runtime, the garbage collector, full symbol and line tables, and every transitively reachable package. 8-15 MiB for a small CLI is normal. Most of it is removable, but only with measurement — guessing which dependency is heavy is almost always wrong.
Procedure
Never apply a flag without a before and after number.
- Build a baseline and record its size.
- Find where the bytes are.
- Apply one change class at a time, measuring after each.
- Verify the binary still runs and its tests still pass.
- Report the table of change → bytes saved → cost.