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

@@ -18,7 +18,7 @@ type rcodeResponseRule struct {
new int
}
func (r *rcodeResponseRule) RewriteResponse(res *dns.Msg, rr dns.RR) {
func (r *rcodeResponseRule) RewriteResponse(res *dns.Msg, _rr dns.RR) {
if r.old == res.Rcode {
res.Rcode = r.new
}
@@ -73,29 +73,29 @@ type regexRCodeRule struct {
// Rewrite rewrites the current request based upon exact match of the name
// in the question section of the request.
func (rule *exactRCodeRule) Rewrite(ctx context.Context, state request.Request) (ResponseRules, Result) {
func (rule *exactRCodeRule) 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 *prefixRCodeRule) Rewrite(ctx context.Context, state request.Request) (ResponseRules, Result) {
func (rule *prefixRCodeRule) 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 *suffixRCodeRule) Rewrite(ctx context.Context, state request.Request) (ResponseRules, Result) {
func (rule *suffixRCodeRule) 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 *substringRCodeRule) Rewrite(ctx context.Context, state request.Request) (ResponseRules, Result) {
func (rule *substringRCodeRule) 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 *regexRCodeRule) Rewrite(ctx context.Context, state request.Request) (ResponseRules, Result) {
func (rule *regexRCodeRule) Rewrite(_ctx context.Context, state request.Request) (ResponseRules, Result) {
return rule.responseRule(len(rule.Pattern.FindStringSubmatch(state.Name())) != 0)
}