initialize better
This commit is contained in:
parent
8d963d7fa0
commit
3e8b67a8ad
4
zone.go
4
zone.go
|
@ -19,7 +19,7 @@ type ZoneData struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// New ...
|
// New ...
|
||||||
func New(name string) *Zone {
|
func NewZone(name string) *Zone {
|
||||||
z := new(Zone)
|
z := new(Zone)
|
||||||
z.Name = name
|
z.Name = name
|
||||||
z.Radix = radix.New()
|
z.Radix = radix.New()
|
||||||
|
@ -31,6 +31,8 @@ func (z *Zone) Insert(r RR) {
|
||||||
if zd == nil {
|
if zd == nil {
|
||||||
zd := new(ZoneData)
|
zd := new(ZoneData)
|
||||||
zd.Name = r.Header().Name
|
zd.Name = r.Header().Name
|
||||||
|
zd.RR = make(map[uint16][]RR)
|
||||||
|
zd.Signatures = make([]*RR_RRSIG, 0)
|
||||||
switch t := r.Header().Rrtype; t {
|
switch t := r.Header().Rrtype; t {
|
||||||
case TypeRRSIG:
|
case TypeRRSIG:
|
||||||
zd.Signatures = append(zd.Signatures, r.(*RR_RRSIG))
|
zd.Signatures = append(zd.Signatures, r.(*RR_RRSIG))
|
||||||
|
|
Loading…
Reference in New Issue