keep stderr quiet when the diff exits with differences
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful

This commit is contained in:
2026-09-12 15:55:34 +10:00
parent 53007a9257
commit dcbd810c34
+4 -1
View File
@@ -123,7 +123,10 @@ func main() {
root.AddCommand(configCmd())
if err := root.Execute(); err != nil {
fmt.Fprintln(os.Stderr, "error:", err)
// errSilent only carries an exit code; the diff is already printed.
if !errors.Is(err, errSilent) {
fmt.Fprintln(os.Stderr, "error:", err)
}
var ee *exitError
if errors.As(err, &ee) {
os.Exit(ee.code)