package dns import ( "net" ) type Record struct { Id string // Internal id. Name string Ip net.IP } type RecordList []Record func (l *RecordList) Add(record Record) { *l = append(*l, record) } func (l RecordList) FindByName(name string) (Record, bool) { for _, record := range l { if record.Name == name { return record, true } } return Record{}, false }