From: Sergey Matveev Date: Sat, 11 Sep 2021 15:22:37 +0000 (+0300) Subject: Unnecessary UCSPI prefix X-Git-Tag: v0.1.0~8 X-Git-Url: http://www.git.cypherpunks.ru/?p=ucspi.git;a=commitdiff_plain;h=16b21a11cabc2846be21d3214664c6deda174ea2 Unnecessary UCSPI prefix --- diff --git a/conn.go b/conn.go index ad9c697..7a6ac42 100644 --- a/conn.go +++ b/conn.go @@ -26,14 +26,14 @@ import ( var aLongTimeAgo = time.Unix(1, 0) -type UCSPIAddr struct { +type Addr struct { ip string port string } -func (addr *UCSPIAddr) Network() string { return "tcp" } +func (addr *Addr) Network() string { return "tcp" } -func (addr *UCSPIAddr) String() string { return addr.ip + ":" + addr.port } +func (addr *Addr) String() string { return addr.ip + ":" + addr.port } type Conn struct { R *os.File @@ -70,11 +70,11 @@ func (conn *Conn) Close() error { } func (conn *Conn) LocalAddr() net.Addr { - return &UCSPIAddr{ip: os.Getenv("TCPLOCALIP"), port: os.Getenv("TCPLOCALPORT")} + return &Addr{ip: os.Getenv("TCPLOCALIP"), port: os.Getenv("TCPLOCALPORT")} } func (conn *Conn) RemoteAddr() net.Addr { - return &UCSPIAddr{ip: os.Getenv("TCPREMOTEIP"), port: os.Getenv("TCPREMOTEPORT")} + return &Addr{ip: os.Getenv("TCPREMOTEIP"), port: os.Getenv("TCPREMOTEPORT")} } func (conn *Conn) SetDeadline(t time.Time) error {