From 5e11584c90ff32b5de9e562a20213a668081ba27 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Thu, 3 Feb 2022 22:35:13 -0500 Subject: [PATCH] Add new TCP NameAddress type --- tcp/name_address.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tcp/name_address.go diff --git a/tcp/name_address.go b/tcp/name_address.go new file mode 100644 index 00000000..586ec6eb --- /dev/null +++ b/tcp/name_address.go @@ -0,0 +1,17 @@ +package tcp + +// NameAddress wraps a string and implements the +// net.Listener interface. +type NameAddress struct { + Address string +} + +// Network returns the network type. Always returns "tcp". +func (n NameAddress) Network() string { + return "tcp" +} + +// String returns the address. +func (n NameAddress) String() string { + return n.Address +}