From ad3fb6125d57aeb59a18c0eaf1f25d18f5010cce Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 11 Jan 2021 20:17:43 -0800 Subject: [PATCH] net/flowtrack: add Tuple.String method Signed-off-by: Brad Fitzpatrick --- net/flowtrack/flowtrack.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/flowtrack/flowtrack.go b/net/flowtrack/flowtrack.go index 8d490d854..5fcd4ab20 100644 --- a/net/flowtrack/flowtrack.go +++ b/net/flowtrack/flowtrack.go @@ -12,6 +12,7 @@ package flowtrack import ( "container/list" + "fmt" "inet.af/netaddr" ) @@ -22,6 +23,10 @@ type Tuple struct { Dst netaddr.IPPort } +func (t Tuple) String() string { + return fmt.Sprintf("(%v => %v)", t.Src, t.Dst) +} + // Cache is an LRU cache keyed by Tuple. // // The zero value is valid to use.