Small tools use the flag package; larger ones use cobra for subcommands, help text and completion. Return non-zero exit codes on failure, write errors to stderr, and keep output machine-friendly with a --json mode for scripting.
← Go theorytheory 0/50 · 0%
Ecosystem · medium
36. Building CLIs
Commands, flags and exit codes.
Check your understanding
1. Errors should be written to…
2. Which library adds subcommands?