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 +}