var errAborted = fmt.Errorf("")
It means "this command has already said what it needed to say, exit non-zero quietly". That is a reasonable thing to want, but expressing it as an error with no message makes the behaviour depend on nothing ever printing it — and something did: cobra printed Error: followed by an empty line, plus a full usage block, until that was fixed on the branch for #29's sibling work.
Suggestion
var errAborted = errors.New("aborted") — a real message, never printed because Execute checks errors.Is before printing. The name then says what it is, a stray print produces something legible instead of a bare prefix, and nothing depends on the message being empty.
Small, but it is the kind of thing that quietly grows a second bug on top of it.
It means "this command has already said what it needed to say, exit non-zero quietly". That is a reasonable thing to want, but expressing it as an error with no message makes the behaviour depend on nothing ever printing it — and something did: cobra printed
Error:followed by an empty line, plus a full usage block, until that was fixed on the branch for #29's sibling work.Suggestion
var errAborted = errors.New("aborted")— a real message, never printed becauseExecutecheckserrors.Isbefore printing. The name then says what it is, a stray print produces something legible instead of a bare prefix, and nothing depends on the message being empty.Small, but it is the kind of thing that quietly grows a second bug on top of it.