mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
deadcode: move sfplib.Lookups to parse_test.go
This commit is contained in:
@ -10,20 +10,6 @@ type SPFRecord struct {
|
||||
Parts []*SPFPart
|
||||
}
|
||||
|
||||
// Lookups returns the number of DNS lookups required by s.
|
||||
func (s *SPFRecord) Lookups() int {
|
||||
count := 0
|
||||
for _, p := range s.Parts {
|
||||
if p.IsLookup {
|
||||
count++
|
||||
}
|
||||
if p.IncludeRecord != nil {
|
||||
count += p.IncludeRecord.Lookups()
|
||||
}
|
||||
}
|
||||
return count
|
||||
}
|
||||
|
||||
// SPFPart stores a part of an SPF record, with attributes.
|
||||
type SPFPart struct {
|
||||
Text string
|
||||
|
@ -27,6 +27,20 @@ func dump(rec *SPFRecord, indent string, w io.Writer) {
|
||||
}
|
||||
}
|
||||
|
||||
// Lookups returns the number of DNS lookups required by s.
|
||||
func (s *SPFRecord) Lookups() int {
|
||||
count := 0
|
||||
for _, p := range s.Parts {
|
||||
if p.IsLookup {
|
||||
count++
|
||||
}
|
||||
if p.IncludeRecord != nil {
|
||||
count += p.IncludeRecord.Lookups()
|
||||
}
|
||||
}
|
||||
return count
|
||||
}
|
||||
|
||||
// Print prints an SPFRecord.
|
||||
func (s *SPFRecord) Print() string {
|
||||
w := &bytes.Buffer{}
|
||||
|
Reference in New Issue
Block a user