mirror of
https://github.com/coredns/coredns.git
synced 2026-04-08 04:55:40 -04:00
lint(revive): fix unused-parameter violations (#7980)
This commit is contained in:
@@ -18,7 +18,7 @@ type ttlResponseRule struct {
|
||||
maxTTL uint32
|
||||
}
|
||||
|
||||
func (r *ttlResponseRule) RewriteResponse(res *dns.Msg, rr dns.RR) {
|
||||
func (r *ttlResponseRule) RewriteResponse(_res *dns.Msg, rr dns.RR) {
|
||||
if rr.Header().Ttl < r.minTTL {
|
||||
rr.Header().Ttl = r.minTTL
|
||||
} else if rr.Header().Ttl > r.maxTTL {
|
||||
@@ -75,29 +75,29 @@ type regexTTLRule struct {
|
||||
|
||||
// Rewrite rewrites the current request based upon exact match of the name
|
||||
// in the question section of the request.
|
||||
func (rule *exactTTLRule) Rewrite(ctx context.Context, state request.Request) (ResponseRules, Result) {
|
||||
func (rule *exactTTLRule) Rewrite(_ctx context.Context, state request.Request) (ResponseRules, Result) {
|
||||
return rule.responseRule(rule.From == state.Name())
|
||||
}
|
||||
|
||||
// Rewrite rewrites the current request when the name begins with the matching string.
|
||||
func (rule *prefixTTLRule) Rewrite(ctx context.Context, state request.Request) (ResponseRules, Result) {
|
||||
func (rule *prefixTTLRule) Rewrite(_ctx context.Context, state request.Request) (ResponseRules, Result) {
|
||||
return rule.responseRule(strings.HasPrefix(state.Name(), rule.Prefix))
|
||||
}
|
||||
|
||||
// Rewrite rewrites the current request when the name ends with the matching string.
|
||||
func (rule *suffixTTLRule) Rewrite(ctx context.Context, state request.Request) (ResponseRules, Result) {
|
||||
func (rule *suffixTTLRule) Rewrite(_ctx context.Context, state request.Request) (ResponseRules, Result) {
|
||||
return rule.responseRule(strings.HasSuffix(state.Name(), rule.Suffix))
|
||||
}
|
||||
|
||||
// Rewrite rewrites the current request based upon partial match of the
|
||||
// name in the question section of the request.
|
||||
func (rule *substringTTLRule) Rewrite(ctx context.Context, state request.Request) (ResponseRules, Result) {
|
||||
func (rule *substringTTLRule) Rewrite(_ctx context.Context, state request.Request) (ResponseRules, Result) {
|
||||
return rule.responseRule(strings.Contains(state.Name(), rule.Substring))
|
||||
}
|
||||
|
||||
// Rewrite rewrites the current request when the name in the question
|
||||
// section of the request matches a regular expression.
|
||||
func (rule *regexTTLRule) Rewrite(ctx context.Context, state request.Request) (ResponseRules, Result) {
|
||||
func (rule *regexTTLRule) Rewrite(_ctx context.Context, state request.Request) (ResponseRules, Result) {
|
||||
return rule.responseRule(len(rule.Pattern.FindStringSubmatch(state.Name())) != 0)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user