diff --git a/dns.go b/dns.go index 9b86886..66bb0f7 100644 --- a/dns.go +++ b/dns.go @@ -21,12 +21,11 @@ type DNSRecord struct { } type DomainPart struct { - Record DNSRecord + Record []DNSRecord Subparts map[string]*DomainPart `json:",omitempty"` } type RecordsTree struct { - Record DNSRecord Children []RecordsTree } @@ -106,11 +105,12 @@ func BuildRecordsTree(records []DNSRecord) *DomainPart { for _, part := range currentDomainNameSplit { if nextDomainPart, found := curPart.Subparts[part]; !found { newPart := new(DomainPart) - newPart.Record = record + newPart.Record = []DNSRecord{record} newPart.Subparts = make(map[string]*DomainPart) curPart.Subparts[strings.ToLower(part)] = newPart curPart = newPart } else { + nextDomainPart.Record = append(nextDomainPart.Record, record) curPart = nextDomainPart } } @@ -192,20 +192,22 @@ func (dp *DomainPart) ToHTMLElements(parts []string) []HTMLElement { } if len(subpart.Subparts) == 0 { - html := fmt.Sprintf( - ` -