Skip to content

Commit

Permalink
Merge pull request #1025 from mackerelio/fix-lint-error
Browse files Browse the repository at this point in the history
fix lint error
  • Loading branch information
rmatsuoka authored Nov 19, 2024
2 parents 8739d8a + 7616f77 commit cf9842c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package main

import (
"errors"
"flag"
"fmt"
"os"
Expand Down Expand Up @@ -115,11 +116,11 @@ func doConfigtest(fs *flag.FlagSet, argv []string) error {
red := color.New(color.FgRed)
yellow := color.New(color.FgYellow)
if err != nil {
return fmt.Errorf(red.Sprintf("[CRITICAL] failed to test config: %s", err))
return errors.New(red.Sprintf("[CRITICAL] failed to test config: %s", err))
}
validResult, err := config.ValidateConfigFile(conf.Conffile)
if err != nil {
return fmt.Errorf(red.Sprintf("[CRITICAL] failed to test config: %s", err))
return errors.New(red.Sprintf("[CRITICAL] failed to test config: %s", err))
}
if len(validResult) > 0 {
var messages string
Expand All @@ -130,7 +131,7 @@ func doConfigtest(fs *flag.FlagSet, argv []string) error {
messages += yellow.Sprintf("[WARNING] %s is unexpected key. Did you mean %s ?\n", v.Key, v.SuggestKey)
}
}
return fmt.Errorf(messages)
return errors.New(messages)
}

fmt.Fprintf(os.Stderr, "SUCCESS (%s)\n", conf.Conffile)
Expand Down

0 comments on commit cf9842c

Please sign in to comment.