Use qname/qtype for lookups

Drop the use of dns.RR when in fact the only thing we use is the name

and type of the RR. Cleans up a bunch of stuff and also stops the weird

making of dns.RRs just for a lookup. Should safe some memory as well.



Fixes: #66
This commit is contained in:
Miek Gieben
2016-04-02 17:49:13 +01:00
parent 9b21646954
commit 2adbdf34d9
5 changed files with 58 additions and 92 deletions

View File

@@ -25,11 +25,8 @@ func TestClosestEncloser(t *testing.T) {
{"blaat.a.miek.nl.", "a.miek.nl."},
}
mk, _ := dns.TypeToRR[dns.TypeA]
rr := mk()
for _, tc := range tests {
rr.Header().Name = tc.in
ce := z.ClosestEncloser(rr)
ce := z.ClosestEncloser(tc.in, dns.TypeA)
if ce != tc.out {
t.Errorf("expected ce to be %s for %s, got %s", tc.out, tc.in, ce)
}