Skip to content

Commit

Permalink
fix golangci critics
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Jan 11, 2024
1 parent 6e698b3 commit fcb133d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ linters:
- forbidigo
- ifshort
- cyclop
- perfsprint
- promlinter
- varnamelen
- nonamedreturns
Expand Down
2 changes: 1 addition & 1 deletion internal_checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

type InternalCheck interface {
Check(context.Context, *bytes.Buffer, []string) int
Check(ctx context.Context, output *bytes.Buffer, args []string) int
}

func execInternal(result *answer, cmd *command, received *receivedStruct) {
Expand Down
4 changes: 2 additions & 2 deletions internal_negate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ func TestNegate(t *testing.T) {

assert.Equal(t, Exec, cmd.ExecType, "exec type")
assert.NotNil(t, cmd.Negate, "parsed negate")
assert.Equal(t, cmd.Negate.WarningStatus, "OK", "parsed negate")
assert.Equal(t, cmd.Negate.CriticalStatus, "UNKNOWN", "parsed negate")
assert.Equal(t, "OK", cmd.Negate.WarningStatus, "parsed negate")
assert.Equal(t, "UNKNOWN", cmd.Negate.CriticalStatus, "parsed negate")
}

func TestExecuteCommandWithNegateI(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions readAndExecute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func BenchmarkParseCommandI(b *testing.B) {
com := parseCommand(cmdLine, &config)
assert.Equal(b, "/bin/test", com.Command, "command parsed")
assert.Equalf(b, map[string]string{"VAR1": "test", "VAR2": "test"}, com.Env, "env parsed")
assert.Equal(b, 2, len(com.Args), "args parsed")
assert.Lenf(b, com.Args, 2, "args parsed")
}

func BenchmarkParseCommandII(b *testing.B) {
Expand All @@ -297,5 +297,5 @@ func BenchmarkParseCommandII(b *testing.B) {
com := parseCommand(cmdLine, &config)
assert.Equal(b, "/bin/test", com.Command, "command parsed")
assert.Equalf(b, map[string]string{"VAR1": "test", "VAR2": "test"}, com.Env, "env parsed")
assert.Equal(b, 13, len(com.Args), "args parsed")
assert.Lenf(b, com.Args, 13, "args parsed")
}

0 comments on commit fcb133d

Please sign in to comment.