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

build: fix some linter warnings #402

Merged
merged 1 commit into from Mar 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion contextual_slog_example_test.go
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
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
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
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
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