mirror of
https://github.com/vishvananda/netlink
synced 2025-02-28 02:20:44 +00:00
Trim whitespace from Addr.String()
If the address has no label, there's extra whitespace at the end.
This commit is contained in:
parent
8e810149a2
commit
b8bd116f5e
2
addr.go
2
addr.go
@ -15,7 +15,7 @@ type Addr struct {
|
|||||||
|
|
||||||
// String returns $ip/$netmask $label
|
// String returns $ip/$netmask $label
|
||||||
func (a Addr) String() string {
|
func (a Addr) String() string {
|
||||||
return fmt.Sprintf("%s %s", a.IPNet, a.Label)
|
return strings.TrimSpace(fmt.Sprintf("%s %s", a.IPNet, a.Label))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseAddr parses the string representation of an address in the
|
// ParseAddr parses the string representation of an address in the
|
||||||
|
Loading…
Reference in New Issue
Block a user