Remove duplicate ASN field from bgpmap
This commit is contained in:
parent
7794ec7bcb
commit
cb247186f3
@ -10,7 +10,11 @@ func getASNRepresentation(asn string) string {
|
|||||||
if records, err := net.LookupTXT(fmt.Sprintf("AS%s.%s", asn, setting.dnsInterface)); err != nil {
|
if records, err := net.LookupTXT(fmt.Sprintf("AS%s.%s", asn, setting.dnsInterface)); err != nil {
|
||||||
return fmt.Sprintf("AS%s", asn)
|
return fmt.Sprintf("AS%s", asn)
|
||||||
} else {
|
} else {
|
||||||
return fmt.Sprintf("AS%s\\n%s", asn, strings.Join(records, " "))
|
result := strings.Join(records, " ")
|
||||||
|
if resultSplit := strings.Split(result, " | "); len(resultSplit) > 1 {
|
||||||
|
result = strings.Join(resultSplit[1:], "\\n")
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("AS%s\\n%s", asn, result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user