#2365·cli

Documentation on optimizing binary size

Author: abitrollyCreated Jun 12, 2026Updated Sep 12, 2026

In https://github.com/urfave/cli/issues/2304 we've tried to trace what happened to build flags that helped to reduce binary size. The information in the thread appeared quite valuable to me, and I thought that urfave/cli is popular enough among Go beginners to share a tutorial on where the binary size comes from, and how to prove and optimize it (if possible).

I am not sure I am capable to write it myself in a concise and visually pleasing way with dumps, pictures and commands. So I leave this issue here to challenge other Go hackers.