Skip to content

Commit

Permalink
lift: ST1012 - error var stdInInvalid should have name of the form er…
Browse files Browse the repository at this point in the history
…rFoo
  • Loading branch information
bhamail committed Jun 2, 2022
1 parent 644c909 commit ff621d9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/cmd/iq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func TestAuditWithIQServerPolicyActionWarning(t *testing.T) {

func TestDoIqInvalidStdIn(t *testing.T) {
err := doIQ(iqCmd, []string{})
assert.Equal(t, customerrors.ErrorShowLogPath{Err: stdInInvalid}, err)
assert.Equal(t, customerrors.ErrorShowLogPath{Err: errStdInInvalid}, err)
}

func TestDoIqParseGoListError(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ var (
ossiCreator ossiServerFactory = ossiFactory{}
unixComments = regexp.MustCompile(`#.*$`)
untilComment = regexp.MustCompile(`(until=)(.*)`)
stdInInvalid = fmt.Errorf("StdIn is invalid or empty. Did you forget to pipe 'go list' to nancy?")
errStdInInvalid = fmt.Errorf("StdIn is invalid or empty. Did you forget to pipe 'go list' to nancy?")
)

//Substitute the _ to .
Expand Down Expand Up @@ -494,7 +494,7 @@ func checkStdIn() (err error) {
if (stat.Mode() & os.ModeCharDevice) == 0 {
logLady.Info("StdIn is valid")
} else {
err = stdInInvalid
err = errStdInInvalid
logLady.Error(err)
}
return
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestProcessConfigInvalidStdIn(t *testing.T) {
logLady, _ = test.NewNullLogger()

err := processConfig()
assert.Equal(t, stdInInvalid, err)
assert.Equal(t, errStdInInvalid, err)
}

func TestDoRootCleanCacheError(t *testing.T) {
Expand Down Expand Up @@ -213,7 +213,7 @@ func validateFormatterVolume(t *testing.T, testConfig types.Configuration, expec
ossiCreator = &ossiFactoryMock{}

err := processConfig()
assert.Equal(t, stdInInvalid, err)
assert.Equal(t, errStdInInvalid, err)
assert.Equal(t, expectedFormatter, configOssi.Formatter)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/sleuth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
func TestSleuthCommandNoArgs(t *testing.T) {
_, err := executeCommand(rootCmd, sleuthCmd.Use)
assert.NotNil(t, err)
assert.Equal(t, customerrors.ErrorShowLogPath{Err: stdInInvalid}, err)
assert.Equal(t, customerrors.ErrorShowLogPath{Err: errStdInInvalid}, err)
}

func TestSleuthCommandPathInvalidName(t *testing.T) {
Expand Down

0 comments on commit ff621d9

Please sign in to comment.