Minor coding style change
This commit is contained in:
parent
f204744a4f
commit
1acc8f48ce
@ -7,15 +7,17 @@ import (
|
||||
)
|
||||
|
||||
func getASNRepresentation(asn string) string {
|
||||
if records, err := net.LookupTXT(fmt.Sprintf("AS%s.%s", asn, setting.dnsInterface)); err != nil {
|
||||
records, err := net.LookupTXT(fmt.Sprintf("AS%s.%s", asn, setting.dnsInterface))
|
||||
if err != nil {
|
||||
// DNS query failed, only use ASN as output
|
||||
return fmt.Sprintf("AS%s", asn)
|
||||
} else {
|
||||
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)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
func birdRouteToGraphviz(servers []string, responses []string, target string) string {
|
||||
|
Loading…
x
Reference in New Issue
Block a user