Skip to content

Commit ab53041

Browse files
authored
Merge pull request #402 from pohly/linter-issues
build: fix some linter warnings
2 parents 569bb3c + ff7c070 commit ab53041

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

contextual_slog_example_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func ExampleSetSlogLogger() {
3131
defer state.Restore()
3232

3333
handler := slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{
34-
ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr {
34+
ReplaceAttr: func(_ /* groups */ []string, a slog.Attr) slog.Attr {
3535
if a.Key == slog.TimeKey {
3636
// Avoid non-deterministic output.
3737
return slog.Attr{}

klogr/output_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
func TestKlogrOutput(t *testing.T) {
3131
test.InitKlog(t)
3232
test.Output(t, test.OutputConfig{
33-
NewLogger: func(out io.Writer, v int, vmodule string) logr.Logger {
33+
NewLogger: func(_ io.Writer, _ int, _ string) logr.Logger {
3434
return klogr.NewWithOptions(klogr.WithFormat(klogr.FormatKlog))
3535
},
3636
})

output_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func BenchmarkKlogOutput(b *testing.B) {
4141

4242
// klogKlogrConfig tests klogr output via klog, using the klog/v2 klogr.
4343
var klogKLogrConfig = test.OutputConfig{
44-
NewLogger: func(out io.Writer, v int, vmodule string) logr.Logger {
44+
NewLogger: func(_ io.Writer, _ int, _ string) logr.Logger {
4545
return klog.NewKlogr()
4646
},
4747
}

test/output.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ func Output(t *testing.T, config OutputConfig) {
584584

585585
if config.NewLogger == nil {
586586
// Test klog.
587-
testOutput(t, printWithKlogLine-1, func(buffer *bytes.Buffer) {
587+
testOutput(t, printWithKlogLine-1, func(_ *bytes.Buffer) {
588588
printWithKlog(test)
589589
})
590590
return

textlogger/textlogger_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func ExampleBacktrace() {
8282
backtraceCounter := 0
8383
config := textlogger.NewConfig(
8484
textlogger.FixedTime(ts), // To get consistent output for each run.
85-
textlogger.Backtrace(func(skip int) (filename string, line int) {
85+
textlogger.Backtrace(func(_ /* skip */ int) (filename string, line int) {
8686
backtraceCounter++
8787
if backtraceCounter == 1 {
8888
// Simulate "missing information".

0 commit comments

Comments
 (0)