deadcode: move sfplib.Lookups to parse_test.go

This commit is contained in:
Tom Limoncelli 2024-03-04 20:22:01 -05:00
parent 3920d19ad4
commit ce12d892df
2 changed files with 14 additions and 14 deletions

View file

@ -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

View file

@ -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{}