mirror of
https://github.com/coredns/coredns.git
synced 2025-11-03 02:33:21 -05:00
add golangci-lint linter (#5499)
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
// ClosestEncloser returns the closest encloser for qname.
|
||||
func (z *Zone) ClosestEncloser(qname string) (*tree.Elem, bool) {
|
||||
|
||||
offset, end := dns.NextLabel(qname, 0)
|
||||
for !end {
|
||||
elem, _ := z.Tree.Search(qname)
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
// Make sure the external miekg/dns dependency is up to date
|
||||
|
||||
func TestInclude(t *testing.T) {
|
||||
|
||||
name, rm, err := test.TempFile(".", "foo\tIN\tA\t127.0.0.1\n")
|
||||
if err != nil {
|
||||
t.Fatalf("Unable to create tmpfile %q: %s", name, err)
|
||||
|
||||
@@ -151,7 +151,6 @@ func (z *Zone) Lookup(ctx context.Context, state request.Request, qname string)
|
||||
|
||||
// If we see NS records, it means the name as been delegated, and we should return the delegation.
|
||||
if nsrrs := elem.Type(dns.TypeNS); nsrrs != nil {
|
||||
|
||||
// If the query is specifically for DS and the qname matches the delegated name, we should
|
||||
// return the DS in the answer section and leave the rest empty, i.e. just continue the loop
|
||||
// and continue searching.
|
||||
@@ -179,7 +178,6 @@ func (z *Zone) Lookup(ctx context.Context, state request.Request, qname string)
|
||||
|
||||
// Found entire name.
|
||||
if found && shot {
|
||||
|
||||
if rrs := elem.Type(dns.TypeCNAME); len(rrs) > 0 && qtype != dns.TypeCNAME {
|
||||
ctx = context.WithValue(ctx, dnsserver.LoopKey{}, loop+1)
|
||||
return z.externalLookup(ctx, state, elem, rrs)
|
||||
@@ -208,7 +206,6 @@ func (z *Zone) Lookup(ctx context.Context, state request.Request, qname string)
|
||||
}
|
||||
|
||||
return rrs, ap.ns(do), additional, Success
|
||||
|
||||
}
|
||||
|
||||
// Haven't found the original name.
|
||||
@@ -248,7 +245,6 @@ func (z *Zone) Lookup(ctx context.Context, state request.Request, qname string)
|
||||
sigs := wildElem.TypeForWildcard(dns.TypeRRSIG, qname)
|
||||
sigs = rrutil.SubTypeSignature(sigs, qtype)
|
||||
rrs = append(rrs, sigs...)
|
||||
|
||||
}
|
||||
return rrs, auth, nil, Success
|
||||
}
|
||||
@@ -290,7 +286,6 @@ func (z *Zone) Lookup(ctx context.Context, state request.Request, qname string)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Out:
|
||||
return nil, ret, nil, rcode
|
||||
@@ -325,7 +320,6 @@ func (a Apex) ns(do bool) []dns.RR {
|
||||
|
||||
// externalLookup adds signatures and tries to resolve CNAMEs that point to external names.
|
||||
func (z *Zone) externalLookup(ctx context.Context, state request.Request, elem *tree.Elem, rrs []dns.RR) ([]dns.RR, []dns.RR, []dns.RR, Result) {
|
||||
|
||||
qtype := state.QType()
|
||||
do := state.Do()
|
||||
|
||||
|
||||
@@ -183,7 +183,6 @@ Restart:
|
||||
retryTicker.Stop()
|
||||
expireTicker.Stop()
|
||||
goto Restart
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,7 +191,6 @@ Restart:
|
||||
func jitter(n int) time.Duration {
|
||||
r := rand.Intn(n)
|
||||
return time.Duration(r) * time.Millisecond
|
||||
|
||||
}
|
||||
|
||||
// MaxSerialIncrement is the maximum difference between two serial numbers. If the difference between
|
||||
|
||||
@@ -139,7 +139,6 @@ func fileParse(c *caddy.Controller) (Zones, error) {
|
||||
return Zones{}, plugin.Error("file", openErr)
|
||||
}
|
||||
log.Warningf("Failed to open %q: trying again in %s", openErr, reload)
|
||||
|
||||
}
|
||||
return Zones{Z: z, Names: names}, nil
|
||||
}
|
||||
|
||||
@@ -75,7 +75,6 @@ Tests:
|
||||
}
|
||||
continue Tests
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user