Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ linters:
- all
- '-ST1005' # disable rule 'Incorrectly formatted error string'
- '-ST1006' # disable rule 'Poorly chosen receiver name'
- '-ST1008' # disable rule 'Function’s error value should be its last return value'
- '-ST1023' # disable rule 'Redundant type in variable declaration'
- '-QF1001' # disable rule 'Apply De Morgan’s law'
- '-QF1012' # disable rule 'Use fmt.Fprintf instead of x.Write(fmt.Sprintf(...))'
Expand Down
8 changes: 4 additions & 4 deletions cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ func Test_Aliases(t *testing.T) {
}
for name, tt := range tests {
t.Run(name, func(t *testing.T) {
err, output := testExecCmd(ctx, strings.Fields(tt.args))
output, err := testExecCmd(ctx, strings.Fields(tt.args))
require.NoError(t, err)
require.Contains(t, output, tt.expected)
})
}
}

// testExecCmd will execute the root cobra command with args and return the output
func testExecCmd(ctx context.Context, args []string) (error, string) {
func testExecCmd(ctx context.Context, args []string) (string, error) {
// Get command
cmd, clients := Init(ctx)

Expand All @@ -257,7 +257,7 @@ func testExecCmd(ctx context.Context, args []string) (error, string) {
cmd.SetArgs(args)
err := cmd.ExecuteContext(ctx)
if err != nil {
return err, ""
return "", err
}
return nil, clientsMock.GetCombinedOutput()
return clientsMock.GetCombinedOutput(), nil
}
Loading