mirror of
https://github.com/coredns/coredns.git
synced 2026-04-07 12:35:33 -04:00
lint(revive): fix unused-parameter violations (#7980)
This commit is contained in:
@@ -47,7 +47,7 @@ type zones map[string][]*zone
|
||||
// that each domain name/zone id pair does exist, and returns a new *CloudDNS.
|
||||
// In addition to this, upstream is passed for doing recursive queries against CNAMEs.
|
||||
// Returns error if it cannot verify any given domain name/zone id pair.
|
||||
func New(ctx context.Context, c gcpDNS, keys map[string][]string, up *upstream.Upstream) (*CloudDNS, error) {
|
||||
func New(_ctx context.Context, c gcpDNS, keys map[string][]string, up *upstream.Upstream) (*CloudDNS, error) {
|
||||
zones := make(map[string][]*zone, len(keys))
|
||||
zoneNames := make([]string, 0, len(keys))
|
||||
for dnsName, hostedZoneDetails := range keys {
|
||||
|
||||
@@ -22,11 +22,11 @@ type fakeGCPClient struct {
|
||||
*gcp.Service
|
||||
}
|
||||
|
||||
func (c fakeGCPClient) zoneExists(projectName, hostedZoneName string) error {
|
||||
func (c fakeGCPClient) zoneExists(_projectName, _hostedZoneName string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c fakeGCPClient) listRRSets(ctx context.Context, projectName, hostedZoneName string) (*gcp.ResourceRecordSetsListResponse, error) {
|
||||
func (c fakeGCPClient) listRRSets(_ctx context.Context, projectName, hostedZoneName string) (*gcp.ResourceRecordSetsListResponse, error) {
|
||||
if projectName == "bad-project" || hostedZoneName == "bad-zone" {
|
||||
return nil, errors.New("the 'parameters.managedZone' resource named 'bad-zone' does not exist")
|
||||
}
|
||||
@@ -148,7 +148,7 @@ func TestCloudDNS(t *testing.T) {
|
||||
}
|
||||
r.Fall = fall.Zero
|
||||
r.Fall.SetZonesFromArgs([]string{"gov."})
|
||||
r.Next = test.HandlerFunc(func(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
r.Next = test.HandlerFunc(func(_ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
state := request.Request{W: w, Req: r}
|
||||
qname := state.Name()
|
||||
m := new(dns.Msg)
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func TestSetupCloudDNS(t *testing.T) {
|
||||
f = func(ctx context.Context, opt option.ClientOption) (gcpDNS, error) {
|
||||
f = func(_ctx context.Context, _opt option.ClientOption) (gcpDNS, error) {
|
||||
return fakeGCPClient{}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user