lint(revive): fix unused-parameter violations (#7980)

This commit is contained in:
Ville Vesilehto
2026-03-30 03:02:20 +03:00
committed by GitHub
parent 6af8fd46fe
commit 6720959b8b
95 changed files with 245 additions and 244 deletions

View File

@@ -8,7 +8,7 @@ import (
type responseWriter struct{ dns.ResponseWriter }
func (r *responseWriter) WriteMsg(m *dns.Msg) error { return nil }
func (r *responseWriter) WriteMsg(_m *dns.Msg) error { return nil }
func (r *responseWriter) Write(buf []byte) (int, error) { return len(buf), nil }
func TestNewRecorder(t *testing.T) {

View File

@@ -80,42 +80,42 @@ func (l *mockListener) Name() string {
return l.name
}
func (l *mockListener) Debug(plugin string, v ...any) {
func (l *mockListener) Debug(_plugin string, _v ...any) {
log(debug, l.name+" mocked debug")
}
func (l *mockListener) Debugf(plugin string, format string, v ...any) {
func (l *mockListener) Debugf(_plugin string, _format string, _v ...any) {
log(debug, l.name+" mocked debug")
}
func (l *mockListener) Info(plugin string, v ...any) {
func (l *mockListener) Info(_plugin string, _v ...any) {
log(info, l.name+" mocked info")
}
func (l *mockListener) Infof(plugin string, format string, v ...any) {
func (l *mockListener) Infof(_plugin string, _format string, _v ...any) {
log(info, l.name+" mocked info")
}
func (l *mockListener) Warning(plugin string, v ...any) {
func (l *mockListener) Warning(_plugin string, _v ...any) {
log(warning, l.name+" mocked warning")
}
func (l *mockListener) Warningf(plugin string, format string, v ...any) {
func (l *mockListener) Warningf(_plugin string, _format string, _v ...any) {
log(warning, l.name+" mocked warning")
}
func (l *mockListener) Error(plugin string, v ...any) {
func (l *mockListener) Error(_plugin string, _v ...any) {
log(err, l.name+" mocked error")
}
func (l *mockListener) Errorf(plugin string, format string, v ...any) {
func (l *mockListener) Errorf(_plugin string, _format string, _v ...any) {
log(err, l.name+" mocked error")
}
func (l *mockListener) Fatal(plugin string, v ...any) {
func (l *mockListener) Fatal(_plugin string, _v ...any) {
log(fatal, l.name+" mocked fatal")
}
func (l *mockListener) Fatalf(plugin string, format string, v ...any) {
func (l *mockListener) Fatalf(_plugin string, _format string, _v ...any) {
log(fatal, l.name+" mocked fatal")
}

View File

@@ -103,7 +103,7 @@ func (t *Transport) Dial(proto string) (*persistConn, bool, error) {
}
// Connect selects an upstream, sends the request and waits for a response.
func (p *Proxy) Connect(ctx context.Context, state request.Request, opts Options) (*dns.Msg, error) {
func (p *Proxy) Connect(_ctx context.Context, state request.Request, opts Options) (*dns.Msg, error) {
start := time.Now()
var proto string

View File

@@ -103,7 +103,7 @@ func TestHealthNoRecursion(t *testing.T) {
}
func TestHealthTimeout(t *testing.T) {
s := dnstest.NewServer(func(w dns.ResponseWriter, r *dns.Msg) {
s := dnstest.NewServer(func(_w dns.ResponseWriter, _r *dns.Msg) {
// timeout
})
defer s.Close()

View File

@@ -170,7 +170,7 @@ func TestConcurrentMixedOperations(t *testing.T) {
// Mix of Int() and Perm() operations running concurrently
for i := range numGoroutines {
wg.Add(1)
go func(id int) {
go func(_id int) {
defer wg.Done()
for j := range numOperations {
if j%2 == 0 {

View File

@@ -308,7 +308,7 @@ func BenchmarkParseFormat(b *testing.B) {
type testProvider map[string]metadata.Func
func (tp testProvider) Metadata(ctx context.Context, state request.Request) context.Context {
func (tp testProvider) Metadata(ctx context.Context, _state request.Request) context.Context {
for k, v := range tp {
metadata.SetValueFunc(ctx, k, v)
}
@@ -319,7 +319,7 @@ type testHandler struct{ ctx context.Context }
func (m *testHandler) Name() string { return "test" }
func (m *testHandler) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
func (m *testHandler) ServeDNS(ctx context.Context, _w dns.ResponseWriter, _r *dns.Msg) (int, error) {
m.ctx = ctx
return 0, nil
}

View File

@@ -12,7 +12,7 @@ import (
"golang.org/x/sys/unix"
)
func control(network, address string, c syscall.RawConn) error {
func control(_network, _address string, c syscall.RawConn) error {
c.Control(func(fd uintptr) {
const maxInt = int(^uint(0) >> 1)
if fd > uintptr(maxInt) {