mirror of
https://github.com/coredns/coredns.git
synced 2026-04-05 11:45:33 -04:00
lint(revive): fix unused-parameter violations (#7980)
This commit is contained in:
8
plugin/cache/cache_test.go
vendored
8
plugin/cache/cache_test.go
vendored
@@ -618,7 +618,7 @@ func BenchmarkCacheResponse(b *testing.B) {
|
||||
}
|
||||
|
||||
func BackendHandler() plugin.Handler {
|
||||
return plugin.HandlerFunc(func(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
return plugin.HandlerFunc(func(_ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
m := new(dns.Msg)
|
||||
m.SetReply(r)
|
||||
m.Response = true
|
||||
@@ -633,7 +633,7 @@ func BackendHandler() plugin.Handler {
|
||||
}
|
||||
|
||||
func nxDomainBackend(ttl int) plugin.Handler {
|
||||
return plugin.HandlerFunc(func(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
return plugin.HandlerFunc(func(_ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
m := new(dns.Msg)
|
||||
m.SetReply(r)
|
||||
m.Response, m.RecursionAvailable = true, true
|
||||
@@ -647,7 +647,7 @@ func nxDomainBackend(ttl int) plugin.Handler {
|
||||
}
|
||||
|
||||
func ttlBackend(ttl int) plugin.Handler {
|
||||
return plugin.HandlerFunc(func(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
return plugin.HandlerFunc(func(_ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
m := new(dns.Msg)
|
||||
m.SetReply(r)
|
||||
m.Response, m.RecursionAvailable = true, true
|
||||
@@ -659,7 +659,7 @@ func ttlBackend(ttl int) plugin.Handler {
|
||||
}
|
||||
|
||||
func servFailBackend(ttl int) plugin.Handler {
|
||||
return plugin.HandlerFunc(func(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
return plugin.HandlerFunc(func(_ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
m := new(dns.Msg)
|
||||
m.SetReply(r)
|
||||
m.Response, m.RecursionAvailable = true, true
|
||||
|
||||
2
plugin/cache/dnssec_test.go
vendored
2
plugin/cache/dnssec_test.go
vendored
@@ -65,7 +65,7 @@ func TestResponseWithDNSSEC(t *testing.T) {
|
||||
}
|
||||
|
||||
func dnssecHandler() plugin.Handler {
|
||||
return plugin.HandlerFunc(func(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
return plugin.HandlerFunc(func(_ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
m := new(dns.Msg)
|
||||
m.SetQuestion("example.org.", dns.TypeA)
|
||||
state := request.Request{W: &test.ResponseWriter{}, Req: r}
|
||||
|
||||
2
plugin/cache/error_test.go
vendored
2
plugin/cache/error_test.go
vendored
@@ -28,7 +28,7 @@ func TestFormErr(t *testing.T) {
|
||||
|
||||
// formErrHandler is a fake plugin implementation which returns a FORMERR for a reply.
|
||||
func formErrHandler() plugin.Handler {
|
||||
return plugin.HandlerFunc(func(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
return plugin.HandlerFunc(func(_ctx context.Context, w dns.ResponseWriter, _r *dns.Msg) (int, error) {
|
||||
m := new(dns.Msg)
|
||||
m.SetQuestion("example.net.", dns.TypeA)
|
||||
m.Rcode = dns.RcodeFormatError
|
||||
|
||||
2
plugin/cache/prefetch_test.go
vendored
2
plugin/cache/prefetch_test.go
vendored
@@ -214,7 +214,7 @@ type verification struct {
|
||||
// 127.0.0.1 and is incremented on every request.
|
||||
func prefetchHandler(qname string, ttl int, fetchc chan struct{}) plugin.Handler {
|
||||
i := 0
|
||||
return plugin.HandlerFunc(func(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
return plugin.HandlerFunc(func(_ctx context.Context, w dns.ResponseWriter, _r *dns.Msg) (int, error) {
|
||||
i++
|
||||
m := new(dns.Msg)
|
||||
m.SetQuestion(qname, dns.TypeA)
|
||||
|
||||
4
plugin/cache/spoof_test.go
vendored
4
plugin/cache/spoof_test.go
vendored
@@ -58,7 +58,7 @@ func TestResponse(t *testing.T) {
|
||||
// spoofHandler is a fake plugin implementation which returns a single A records for example.org. The qname in the
|
||||
// question section is set to example.NET (i.e. they *don't* match).
|
||||
func spoofHandler(response bool) plugin.Handler {
|
||||
return plugin.HandlerFunc(func(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
return plugin.HandlerFunc(func(_ctx context.Context, w dns.ResponseWriter, _r *dns.Msg) (int, error) {
|
||||
m := new(dns.Msg)
|
||||
m.SetQuestion("example.net.", dns.TypeA)
|
||||
m.Response = response
|
||||
@@ -71,7 +71,7 @@ func spoofHandler(response bool) plugin.Handler {
|
||||
// spoofHandlerType is a fake plugin implementation which returns a single MX records for example.org. The qtype in the
|
||||
// question section is set to A.
|
||||
func spoofHandlerType() plugin.Handler {
|
||||
return plugin.HandlerFunc(func(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
return plugin.HandlerFunc(func(_ctx context.Context, w dns.ResponseWriter, _r *dns.Msg) (int, error) {
|
||||
m := new(dns.Msg)
|
||||
m.SetQuestion("example.org.", dns.TypeA)
|
||||
m.Response = true
|
||||
|
||||
Reference in New Issue
Block a user