control/controlclient: trim /32 suffix a bit more succinctly
This commit is contained in:
@ -75,10 +75,7 @@ func (nm *NetworkMap) Concise() string {
|
|||||||
for _, p := range nm.Peers {
|
for _, p := range nm.Peers {
|
||||||
aip := make([]string, len(p.AllowedIPs))
|
aip := make([]string, len(p.AllowedIPs))
|
||||||
for i, a := range p.AllowedIPs {
|
for i, a := range p.AllowedIPs {
|
||||||
s := fmt.Sprint(a)
|
s := strings.TrimSuffix(fmt.Sprint(a), "/32")
|
||||||
if strings.HasSuffix(s, "/32") {
|
|
||||||
s = s[0 : len(s)-3]
|
|
||||||
}
|
|
||||||
aip[i] = s
|
aip[i] = s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user