urfave/cli directly uses text/template, and unfortunately this partially disables dead code elimination. However, "partial" in this context can result in significantly larger binaries depending on how many other dependencies you have. Full DCE can result in significant binary size reductions (50%+-).
Cobra recently added a fix/workaround for a similar issue:
spf13/cobra#1956
I appreciate there may not be a non-breaking way to solve this in v3.