Skip to content

Commit

Permalink
Merge pull request #268 from thockin/master
Browse files Browse the repository at this point in the history
Fix lint: named but unused params
  • Loading branch information
pohly authored Feb 13, 2024
2 parents c9b5476 + 1cc4a3c commit 7141c7e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion example_slogr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
)

var debugWithoutTime = &slog.HandlerOptions{
ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr {
ReplaceAttr: func(_ []string, a slog.Attr) slog.Attr {
if a.Key == "time" {
return slog.Attr{}
}
Expand Down
4 changes: 2 additions & 2 deletions funcr/funcr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ func TestSanitize(t *testing.T) {

func TestEnabled(t *testing.T) {
t.Run("default V", func(t *testing.T) {
log := newSink(func(prefix, args string) {}, NewFormatter(Options{}))
log := newSink(func(_, _ string) {}, NewFormatter(Options{}))
if !log.Enabled(0) {
t.Errorf("expected true")
}
Expand All @@ -849,7 +849,7 @@ func TestEnabled(t *testing.T) {
}
})
t.Run("V=9", func(t *testing.T) {
log := newSink(func(prefix, args string) {}, NewFormatter(Options{Verbosity: 9}))
log := newSink(func(_, _ string) {}, NewFormatter(Options{Verbosity: 9}))
if !log.Enabled(8) {
t.Errorf("expected true")
}
Expand Down
2 changes: 1 addition & 1 deletion funcr/slogsink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func TestRunSlogTests(t *testing.T) {
}

func TestLogrSlogConversion(t *testing.T) {
f := New(func(prefix, args string) {}, Options{})
f := New(func(_, _ string) {}, Options{})
f2 := logr.FromSlogHandler(logr.ToSlogHandler(f))
if want, got := f, f2; got != want {
t.Helper()
Expand Down
2 changes: 1 addition & 1 deletion logr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestEnabled(t *testing.T) {
calledEnabled := 0

sink := &testLogSink{}
sink.fnEnabled = func(lvl int) bool {
sink.fnEnabled = func(_ int) bool {
calledEnabled++
return true
}
Expand Down
2 changes: 1 addition & 1 deletion slogr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestFromSlogHandler(t *testing.T) {
}

var debugWithoutTime = &slog.HandlerOptions{
ReplaceAttr: func(groups []string, a slog.Attr) slog.Attr {
ReplaceAttr: func(_ []string, a slog.Attr) slog.Attr {
if a.Key == "time" {
return slog.Attr{}
}
Expand Down

0 comments on commit 7141c7e

Please sign in to comment.