chore(all): replace all fmt.Errorf without paramters with errors.New (#21068)

This commit is contained in:
yukionfire
2024-07-25 14:54:49 +02:00
committed by GitHub
parent 6a2d039e12
commit d6ad92db0f
57 changed files with 127 additions and 103 deletions
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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))