mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-14 19:00:50 +01:00
Remove unused variable
This commit is contained in:
parent
e69b8f5788
commit
3be68ae552
@ -28,14 +28,12 @@ func (a Addr) String() string {
|
||||
|
||||
type Conn struct {
|
||||
session quic.Connection
|
||||
remoteAddr Addr
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
func NewConn(session quic.Connection, serverAddress string) net.Conn {
|
||||
func NewConn(session quic.Connection) net.Conn {
|
||||
return &Conn{
|
||||
session: session,
|
||||
remoteAddr: Addr{addr: serverAddress},
|
||||
ctx: context.Background(),
|
||||
}
|
||||
}
|
||||
@ -61,11 +59,8 @@ func (c *Conn) Write(b []byte) (int, error) {
|
||||
}
|
||||
|
||||
func (c *Conn) RemoteAddr() net.Addr {
|
||||
if c.session != nil {
|
||||
return c.session.RemoteAddr()
|
||||
}
|
||||
return c.remoteAddr
|
||||
}
|
||||
|
||||
func (c *Conn) LocalAddr() net.Addr {
|
||||
if c.session != nil {
|
||||
|
@ -55,7 +55,7 @@ func (d Dialer) Dial(ctx context.Context, address string) (net.Conn, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
conn := NewConn(session, address)
|
||||
conn := NewConn(session)
|
||||
return conn, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user