1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

go get -u github.com/miekg/dns v1.1.31 (#846)

This commit is contained in:
Tom Limoncelli
2020-09-04 16:26:56 -04:00
committed by GitHub
parent 0ce8bed72f
commit 4432d38252
4 changed files with 48 additions and 23 deletions

View File

@@ -17,15 +17,15 @@ func parseAndRegen(t *testing.T, buf *bytes.Buffer, expected string) {
// get back the same string.
// This is used after any WriteZoneFile test as an extra verification step.
// Parse the output:
zp := dns.NewZoneParser(buf, "bosun.org", "bozun.org.zone")
var parsed []dns.RR
for x := range dns.ParseZone(buf, "bosun.org", "bosun.org.zone") {
if x.Error != nil {
log.Fatalf("Error in zonefile: %v", x.Error)
} else {
parsed = append(parsed, x.RR)
}
for rr, ok := zp.Next(); ok; rr, ok = zp.Next() {
parsed = append(parsed, rr)
}
if err := zp.Err(); err != nil {
log.Fatalf("Error in zonefile: %v", err)
}
// Generate it back:
buf2 := &bytes.Buffer{}
WriteZoneFileRR(buf2, parsed, "bosun.org")