Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint: named but unused params #268

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading