From 69d1414a322dd2ad9b669bceaf59617b333e424a Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Wed, 14 Aug 2019 15:00:58 -0700 Subject: Add tcpip.AddressWithPrefix.String PiperOrigin-RevId: 263436592 --- pkg/tcpip/tcpip.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg') diff --git a/pkg/tcpip/tcpip.go b/pkg/tcpip/tcpip.go index 119712d2f..db6d5a9bf 100644 --- a/pkg/tcpip/tcpip.go +++ b/pkg/tcpip/tcpip.go @@ -1072,6 +1072,11 @@ type AddressWithPrefix struct { PrefixLen int } +// String implements the fmt.Stringer interface. +func (a AddressWithPrefix) String() string { + return fmt.Sprintf("%s/%d", a.Address, a.PrefixLen) +} + // ProtocolAddress is an address and the network protocol it is associated // with. type ProtocolAddress struct { -- cgit v1.2.3