File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 33package main
44
55import (
6+ "errors"
67 "flag"
78 "fmt"
89 "os"
@@ -115,11 +116,11 @@ func doConfigtest(fs *flag.FlagSet, argv []string) error {
115116 red := color .New (color .FgRed )
116117 yellow := color .New (color .FgYellow )
117118 if err != nil {
118- return fmt . Errorf (red .Sprintf ("[CRITICAL] failed to test config: %s" , err ))
119+ return errors . New (red .Sprintf ("[CRITICAL] failed to test config: %s" , err ))
119120 }
120121 validResult , err := config .ValidateConfigFile (conf .Conffile )
121122 if err != nil {
122- return fmt . Errorf (red .Sprintf ("[CRITICAL] failed to test config: %s" , err ))
123+ return errors . New (red .Sprintf ("[CRITICAL] failed to test config: %s" , err ))
123124 }
124125 if len (validResult ) > 0 {
125126 var messages string
@@ -130,7 +131,7 @@ func doConfigtest(fs *flag.FlagSet, argv []string) error {
130131 messages += yellow .Sprintf ("[WARNING] %s is unexpected key. Did you mean %s ?\n " , v .Key , v .SuggestKey )
131132 }
132133 }
133- return fmt . Errorf (messages )
134+ return errors . New (messages )
134135 }
135136
136137 fmt .Fprintf (os .Stderr , "SUCCESS (%s)\n " , conf .Conffile )
You can’t perform that action at this time.
0 commit comments