mirror of
https://github.com/coredns/coredns.git
synced 2026-04-05 03:35:33 -04:00
lint(revive): fix unused-parameter violations (#7980)
This commit is contained in:
@@ -62,9 +62,9 @@ func AddPrefix(b []byte) (m []byte) {
|
||||
|
||||
// These methods implement the dns.ResponseWriter interface from Go DNS.
|
||||
|
||||
func (w *DoQWriter) TsigStatus() error { return w.tsigStatus }
|
||||
func (w *DoQWriter) TsigTimersOnly(b bool) {}
|
||||
func (w *DoQWriter) Hijack() {}
|
||||
func (w *DoQWriter) LocalAddr() net.Addr { return w.localAddr }
|
||||
func (w *DoQWriter) RemoteAddr() net.Addr { return w.remoteAddr }
|
||||
func (w *DoQWriter) Network() string { return "" }
|
||||
func (w *DoQWriter) TsigStatus() error { return w.tsigStatus }
|
||||
func (w *DoQWriter) TsigTimersOnly(_b bool) {}
|
||||
func (w *DoQWriter) Hijack() {}
|
||||
func (w *DoQWriter) LocalAddr() net.Addr { return w.localAddr }
|
||||
func (w *DoQWriter) RemoteAddr() net.Addr { return w.remoteAddr }
|
||||
func (w *DoQWriter) Network() string { return "" }
|
||||
|
||||
@@ -30,7 +30,7 @@ func init() {
|
||||
})
|
||||
}
|
||||
|
||||
func newContext(i *caddy.Instance) caddy.Context {
|
||||
func newContext(_i *caddy.Instance) caddy.Context {
|
||||
return &dnsContext{keysToConfigs: make(map[string]*Config)}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ var _ caddy.Context = &dnsContext{}
|
||||
// InspectServerBlocks make sure that everything checks out before
|
||||
// executing directives and otherwise prepares the directives to
|
||||
// be parsed and executed.
|
||||
func (h *dnsContext) InspectServerBlocks(sourceFile string, serverBlocks []caddyfile.ServerBlock) ([]caddyfile.ServerBlock, error) {
|
||||
func (h *dnsContext) InspectServerBlocks(_sourceFile string, serverBlocks []caddyfile.ServerBlock) ([]caddyfile.ServerBlock, error) {
|
||||
// Normalize and check all the zone names and check for duplicates
|
||||
for ib, s := range serverBlocks {
|
||||
// Walk the s.Keys and expand any reverse address in their proper DNS in-addr zones. If the expansions leads for
|
||||
|
||||
@@ -414,7 +414,7 @@ func (s *Server) Tracer() ot.Tracer {
|
||||
}
|
||||
|
||||
// errorFunc responds to an DNS request with an error.
|
||||
func errorFunc(server string, w dns.ResponseWriter, r *dns.Msg, rc int) {
|
||||
func errorFunc(_server string, w dns.ResponseWriter, r *dns.Msg, rc int) {
|
||||
state := request.Request{W: w, Req: r}
|
||||
|
||||
answer := new(dns.Msg)
|
||||
|
||||
@@ -106,7 +106,7 @@ func (s *ServergRPC) Serve(l net.Listener) error {
|
||||
}
|
||||
|
||||
if s.Tracer() != nil {
|
||||
onlyIfParent := func(parentSpanCtx opentracing.SpanContext, method string, req, resp any) bool {
|
||||
onlyIfParent := func(parentSpanCtx opentracing.SpanContext, _method string, _req, _resp any) bool {
|
||||
return parentSpanCtx != nil
|
||||
}
|
||||
serverOpts = append(serverOpts, grpc.UnaryInterceptor(otgrpc.OpenTracingServerInterceptor(s.Tracer(), otgrpc.IncludingSpans(onlyIfParent))))
|
||||
@@ -129,7 +129,7 @@ func (s *ServergRPC) Serve(l net.Listener) error {
|
||||
}
|
||||
|
||||
// ServePacket implements caddy.UDPServer interface.
|
||||
func (s *ServergRPC) ServePacket(p net.PacketConn) error { return nil }
|
||||
func (s *ServergRPC) ServePacket(_p net.PacketConn) error { return nil }
|
||||
|
||||
// Listen implements caddy.TCPServer interface.
|
||||
func (s *ServergRPC) Listen() (net.Listener, error) {
|
||||
@@ -242,7 +242,7 @@ func (r *gRPCresponse) Write(b []byte) (int, error) {
|
||||
|
||||
func (r *gRPCresponse) Close() error { return nil }
|
||||
func (r *gRPCresponse) TsigStatus() error { return r.tsigStatus }
|
||||
func (r *gRPCresponse) TsigTimersOnly(b bool) {}
|
||||
func (r *gRPCresponse) TsigTimersOnly(_b bool) {}
|
||||
func (r *gRPCresponse) Hijack() {}
|
||||
func (r *gRPCresponse) LocalAddr() net.Addr { return r.localAddr }
|
||||
func (r *gRPCresponse) RemoteAddr() net.Addr { return r.remoteAddr }
|
||||
|
||||
@@ -129,7 +129,7 @@ func (s *ServerHTTPS) Serve(l net.Listener) error {
|
||||
}
|
||||
|
||||
// ServePacket implements caddy.UDPServer interface.
|
||||
func (s *ServerHTTPS) ServePacket(p net.PacketConn) error { return nil }
|
||||
func (s *ServerHTTPS) ServePacket(_p net.PacketConn) error { return nil }
|
||||
|
||||
// Listen implements caddy.TCPServer interface.
|
||||
func (s *ServerHTTPS) Listen() (net.Listener, error) {
|
||||
|
||||
@@ -132,7 +132,7 @@ func (s *ServerHTTPS3) ServePacket(pc net.PacketConn) error {
|
||||
|
||||
// Listen function not used in HTTP/3, but defined for compatibility
|
||||
func (s *ServerHTTPS3) Listen() (net.Listener, error) { return nil, nil }
|
||||
func (s *ServerHTTPS3) Serve(l net.Listener) error { return nil }
|
||||
func (s *ServerHTTPS3) Serve(_l net.Listener) error { return nil }
|
||||
|
||||
// OnStartupComplete lists the sites served by this server
|
||||
// and any relevant information, assuming Quiet is false.
|
||||
|
||||
@@ -163,7 +163,7 @@ func testConfigWithPlugin(p *contextCapturingPlugin) *Config {
|
||||
ListenHosts: []string{"127.0.0.1"},
|
||||
Port: "443",
|
||||
}
|
||||
c.AddPlugin(func(next plugin.Handler) plugin.Handler { return p })
|
||||
c.AddPlugin(func(_next plugin.Handler) plugin.Handler { return p })
|
||||
return c
|
||||
}
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ func (s *ServerQUIC) Stop() error {
|
||||
}
|
||||
|
||||
// Serve implements caddy.TCPServer interface.
|
||||
func (s *ServerQUIC) Serve(l net.Listener) error { return nil }
|
||||
func (s *ServerQUIC) Serve(_l net.Listener) error { return nil }
|
||||
|
||||
// Listen implements caddy.TCPServer interface.
|
||||
func (s *ServerQUIC) Listen() (net.Listener, error) { return nil, nil }
|
||||
|
||||
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
type testPlugin struct{}
|
||||
|
||||
func (tp testPlugin) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
func (tp testPlugin) ServeDNS(_ctx context.Context, _w dns.ResponseWriter, _r *dns.Msg) (int, error) {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ type blockingPlugin struct {
|
||||
|
||||
func (b *blockingPlugin) Name() string { return "blocking" }
|
||||
|
||||
func (b *blockingPlugin) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
func (b *blockingPlugin) ServeDNS(_ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
// Respond immediately to avoid waiting in dns.Exchange
|
||||
m := new(dns.Msg)
|
||||
m.SetRcodeFormatError(r)
|
||||
@@ -51,7 +51,7 @@ func testConfig(transport string, p plugin.Handler) *Config {
|
||||
Stacktrace: false,
|
||||
}
|
||||
|
||||
c.AddPlugin(func(next plugin.Handler) plugin.Handler { return p })
|
||||
c.AddPlugin(func(_next plugin.Handler) plugin.Handler { return p })
|
||||
return c
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ func (s *ServerTLS) Serve(l net.Listener) error {
|
||||
}
|
||||
|
||||
// ServePacket implements caddy.UDPServer interface.
|
||||
func (s *ServerTLS) ServePacket(p net.PacketConn) error { return nil }
|
||||
func (s *ServerTLS) ServePacket(_p net.PacketConn) error { return nil }
|
||||
|
||||
// Listen implements caddy.TCPServer interface.
|
||||
func (s *ServerTLS) Listen() (net.Listener, error) {
|
||||
|
||||
Reference in New Issue
Block a user