Skip to content

Instantly share code, notes, and snippets.

@FiloSottile
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FiloSottile/c002ba7a9855223a795b to your computer and use it in GitHub Desktop.
Save FiloSottile/c002ba7a9855223a795b to your computer and use it in GitHub Desktop.
rrSets := map[uint16][]dns.RR{}
for _, rr := range r.Response.Answer {
rrtype := rr.Header().Rrtype
set, ok := rrSets[rrtype]
if !ok {
set = []dns.RR{}
}
rrSets[rrtype] = append(set, rr)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment