Skip to content

Commit

Permalink
Merge pull request #173 from thockin/master
Browse files Browse the repository at this point in the history
Fix golangci-lint fails
  • Loading branch information
pohly committed Mar 31, 2023
2 parents 4da5305 + d1187da commit 82f9555
Show file tree
Hide file tree
Showing 5 changed files with 331 additions and 206 deletions.
4 changes: 2 additions & 2 deletions benchmark/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ func BenchmarkDiscardWithName(b *testing.B) {
doWithName(b, log)
}

func noopKV(prefix, args string) {}
func noopJSON(obj string) {}
func noopKV(_, _ string) {}
func noopJSON(_ string) {}

func BenchmarkFuncrLogInfoOneArg(b *testing.B) {
var log logr.Logger = funcr.New(noopKV, funcr.Options{})
Expand Down
4 changes: 2 additions & 2 deletions funcr/funcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ func (f Formatter) FormatInfo(level int, msg string, kvList []interface{}) (pref
}

// FormatError renders an Error log message into strings. The prefix will be
// empty when no names were set (via AddNames), or when the output is
// empty when no names were set (via AddNames), or when the output is
// configured for JSON.
func (f Formatter) FormatError(err error, msg string, kvList []interface{}) (prefix, argsStr string) {
args := make([]interface{}, 0, 64) // using a constant here impacts perf
Expand All @@ -766,7 +766,7 @@ func (f Formatter) FormatError(err error, msg string, kvList []interface{}) (pre
loggableErr = err.Error()
}
args = append(args, "error", loggableErr)
return f.prefix, f.render(args, kvList)
return prefix, f.render(args, kvList)
}

// AddName appends the specified name. funcr uses '/' characters to separate
Expand Down

0 comments on commit 82f9555

Please sign in to comment.