chore(all): replace all fmt.Errorf without paramters with errors.New (#21068)
This commit is contained in:
@@ -310,7 +310,7 @@ func parseEnvDuration(input string) (time.Duration, error) {
|
||||
}
|
||||
|
||||
if duration <= 0 {
|
||||
return 0, fmt.Errorf("must be greater than 0")
|
||||
return 0, errors.New("must be greater than 0")
|
||||
}
|
||||
|
||||
return duration, nil
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"errors"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
|
||||
@@ -19,7 +19,7 @@ func VersionCmd() *cobra.Command {
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
version, ok := debug.ReadBuildInfo()
|
||||
if !ok {
|
||||
return fmt.Errorf("failed to get hubl version")
|
||||
return errors.New("failed to get hubl version")
|
||||
}
|
||||
|
||||
cmd.Printf("hubl version: %s\n", strings.TrimSpace(version.Main.Version))
|
||||
|
||||
Reference in New Issue
Block a user