(records []dns.RR)
| 208 | } |
| 209 | |
| 210 | func groupRecords(records []dns.RR) map[Key][]dns.RR { |
| 211 | // group records by name+type and optionally identifier |
| 212 | grouped := map[Key][]dns.RR{} |
| 213 | for _, record := range records { |
| 214 | var identifier string |
| 215 | if aws, ok := record.(*AWSRR); ok { |
| 216 | identifier = aws.Identifier |
| 217 | } |
| 218 | if alias, ok := record.(*dns.PrivateRR); ok { |
| 219 | // issue #195: alias records need to be keyed by the type of the alias too |
| 220 | rdata := alias.Data.(*ALIASRdata) |
| 221 | identifier += "@" + rdata.Type |
| 222 | } |
| 223 | key := Key{record.Header().Name, record.Header().Rrtype, identifier} |
| 224 | grouped[key] = append(grouped[key], record) |
| 225 | } |
| 226 | return grouped |
| 227 | } |
| 228 | |
| 229 | type importArgs struct { |
| 230 | name string |
no outgoing calls
no test coverage detected