Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit cd46754

Browse files
committed
use errors.New where applicable
1 parent e08f1df commit cd46754

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cmd/analyze.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package cmd
1818

1919
import (
20+
"errors"
2021
"fmt"
2122
"os"
2223
"strings"
@@ -50,7 +51,7 @@ var analyzeCmd = &cobra.Command{
5051

5152
func checkAnalyzeArgNum(args []string) error {
5253
if len(args) != 1 {
53-
return fmt.Errorf("'analyze' requires one image as an argument: container-diff analyze [image]")
54+
return errors.New("'analyze' requires one image as an argument: container-diff analyze [image]")
5455
}
5556
return nil
5657
}

cmd/diff.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package cmd
1818

1919
import (
20+
"errors"
2021
"fmt"
2122
"os"
2223
"strings"
@@ -51,7 +52,7 @@ var diffCmd = &cobra.Command{
5152

5253
func checkDiffArgNum(args []string) error {
5354
if len(args) != 2 {
54-
return fmt.Errorf("'diff' requires two images as arguments: container-diff diff [image1] [image2]")
55+
return errors.New("'diff' requires two images as arguments: container-diff diff [image1] [image2]")
5556
}
5657
return nil
5758
}

0 commit comments

Comments
 (0)