From 02dd47405600d789e803cadc2f30580d7a39b885 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Tue, 16 Sep 2014 07:31:20 +0100 Subject: [PATCH] Dont export typeToRR (old rr_mk) --- dns_test.go | 4 ++-- msg.go | 2 +- types.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dns_test.go b/dns_test.go index 2c31856e..b3063c90 100644 --- a/dns_test.go +++ b/dns_test.go @@ -437,7 +437,7 @@ func TestToRFC3597(t *testing.T) { func TestNoRdataPack(t *testing.T) { data := make([]byte, 1024) - for typ, fn := range TypeToRR { + for typ, fn := range typeToRR { if typ == TypeCAA { continue // TODO(miek): known omission } @@ -454,7 +454,7 @@ func TestNoRdataPack(t *testing.T) { // TODO(miek): fix dns buffer too small errors this throws func TestNoRdataUnpack(t *testing.T) { data := make([]byte, 1024) - for typ, fn := range TypeToRR { + for typ, fn := range typeToRR { if typ == TypeSOA || typ == TypeTSIG || typ == TypeWKS { // SOA, TSIG will not be seen (like this) in dyn. updates? // WKS is an bug, but...deprecated record. diff --git a/msg.go b/msg.go index af2958bd..45f9f488 100644 --- a/msg.go +++ b/msg.go @@ -1329,7 +1329,7 @@ func UnpackRR(msg []byte, off int) (rr RR, off1 int, err error) { } end := off + int(h.Rdlength) // make an rr of that type and re-unpack. - mk, known := TypeToRR[h.Rrtype] + mk, known := typeToRR[h.Rrtype] if !known { rr = new(RFC3597) } else { diff --git a/types.go b/types.go index fcb22c21..e66aa3cc 100644 --- a/types.go +++ b/types.go @@ -1576,7 +1576,7 @@ func copyIP(ip net.IP) net.IP { } // Map of constructors for each RR type. -var TypeToRR = map[uint16]func() RR{ +var typeToRR = map[uint16]func() RR{ TypeA: func() RR { return new(A) }, TypeAAAA: func() RR { return new(AAAA) }, TypeAFSDB: func() RR { return new(AFSDB) },