Skip to content

Commit

Permalink
Merge pull request #402 from pohly/linter-issues
Browse files Browse the repository at this point in the history
build: fix some linter warnings
  • Loading branch information
k8s-ci-robot authored Mar 13, 2024
2 parents 569bb3c + ff7c070 commit ab53041
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contextual_slog_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func ExampleSetSlogLogger() {
defer state.Restore()

handler := slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr {
ReplaceAttr: func(_ /* groups */ []string, a slog.Attr) slog.Attr {
if a.Key == slog.TimeKey {
// Avoid non-deterministic output.
return slog.Attr{}
Expand Down
2 changes: 1 addition & 1 deletion klogr/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
func TestKlogrOutput(t *testing.T) {
test.InitKlog(t)
test.Output(t, test.OutputConfig{
NewLogger: func(out io.Writer, v int, vmodule string) logr.Logger {
NewLogger: func(_ io.Writer, _ int, _ string) logr.Logger {
return klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog))
},
})
Expand Down
2 changes: 1 addition & 1 deletion output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func BenchmarkKlogOutput(b *testing.B) {

// klogKlogrConfig tests klogr output via klog, using the klog/v2 klogr.
var klogKLogrConfig = test.OutputConfig{
NewLogger: func(out io.Writer, v int, vmodule string) logr.Logger {
NewLogger: func(_ io.Writer, _ int, _ string) logr.Logger {
return klog.NewKlogr()
},
}
Expand Down
2 changes: 1 addition & 1 deletion test/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ func Output(t *testing.T, config OutputConfig) {

if config.NewLogger == nil {
// Test klog.
testOutput(t, printWithKlogLine-1, func(buffer *bytes.Buffer) {
testOutput(t, printWithKlogLine-1, func(_ *bytes.Buffer) {
printWithKlog(test)
})
return
Expand Down
2 changes: 1 addition & 1 deletion textlogger/textlogger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func ExampleBacktrace() {
backtraceCounter := 0
config := textlogger.NewConfig(
textlogger.FixedTime(ts), // To get consistent output for each run.
textlogger.Backtrace(func(skip int) (filename string, line int) {
textlogger.Backtrace(func(_ /* skip */ int) (filename string, line int) {
backtraceCounter++
if backtraceCounter == 1 {
// Simulate "missing information".
Expand Down

0 comments on commit ab53041

Please sign in to comment.