From bec0863b53777f313396a10f0bc1349139d1009e Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Thu, 28 Apr 2016 13:44:15 -0700 Subject: [PATCH] net: remove unneeded tags from dnsRR structs DNS packing and unpacking uses hand-coded struct walking functions rather than reflection, so these tags are unneeded and just contribute to their runtime reflect metadata size. Change-Id: I2db09d5159912bcbc3b482cbf23a50fa8fa807fa Reviewed-on: https://go-review.googlesource.com/22594 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/net/dnsmsg.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/net/dnsmsg.go b/src/net/dnsmsg.go index 7bde97667fa..afdb44c0ea5 100644 --- a/src/net/dnsmsg.go +++ b/src/net/dnsmsg.go @@ -109,7 +109,7 @@ const ( // DNS queries. type dnsQuestion struct { - Name string `net:"domain-name"` // `net:"domain-name"` specifies encoding; see packers below + Name string Qtype uint16 Qclass uint16 } @@ -124,7 +124,7 @@ func (q *dnsQuestion) Walk(f func(v interface{}, name, tag string) bool) bool { // There are many types of messages, // but they all share the same header. type dnsRR_Header struct { - Name string `net:"domain-name"` + Name string Rrtype uint16 Class uint16 Ttl uint32 @@ -152,7 +152,7 @@ type dnsRR interface { type dnsRR_CNAME struct { Hdr dnsRR_Header - Cname string `net:"domain-name"` + Cname string } func (rr *dnsRR_CNAME) Header() *dnsRR_Header { @@ -166,7 +166,7 @@ func (rr *dnsRR_CNAME) Walk(f func(v interface{}, name, tag string) bool) bool { type dnsRR_MX struct { Hdr dnsRR_Header Pref uint16 - Mx string `net:"domain-name"` + Mx string } func (rr *dnsRR_MX) Header() *dnsRR_Header { @@ -179,7 +179,7 @@ func (rr *dnsRR_MX) Walk(f func(v interface{}, name, tag string) bool) bool { type dnsRR_NS struct { Hdr dnsRR_Header - Ns string `net:"domain-name"` + Ns string } func (rr *dnsRR_NS) Header() *dnsRR_Header { @@ -192,7 +192,7 @@ func (rr *dnsRR_NS) Walk(f func(v interface{}, name, tag string) bool) bool { type dnsRR_PTR struct { Hdr dnsRR_Header - Ptr string `net:"domain-name"` + Ptr string } func (rr *dnsRR_PTR) Header() *dnsRR_Header { @@ -205,8 +205,8 @@ func (rr *dnsRR_PTR) Walk(f func(v interface{}, name, tag string) bool) bool { type dnsRR_SOA struct { Hdr dnsRR_Header - Ns string `net:"domain-name"` - Mbox string `net:"domain-name"` + Ns string + Mbox string Serial uint32 Refresh uint32 Retry uint32 @@ -263,7 +263,7 @@ type dnsRR_SRV struct { Priority uint16 Weight uint16 Port uint16 - Target string `net:"domain-name"` + Target string } func (rr *dnsRR_SRV) Header() *dnsRR_Header { @@ -280,7 +280,7 @@ func (rr *dnsRR_SRV) Walk(f func(v interface{}, name, tag string) bool) bool { type dnsRR_A struct { Hdr dnsRR_Header - A uint32 `net:"ipv4"` + A uint32 } func (rr *dnsRR_A) Header() *dnsRR_Header { @@ -293,7 +293,7 @@ func (rr *dnsRR_A) Walk(f func(v interface{}, name, tag string) bool) bool { type dnsRR_AAAA struct { Hdr dnsRR_Header - AAAA [16]byte `net:"ipv6"` + AAAA [16]byte } func (rr *dnsRR_AAAA) Header() *dnsRR_Header {