Remove unused variable

This commit is contained in:
Zoltán Papp 2024-12-06 12:22:06 +01:00
parent e69b8f5788
commit 3be68ae552
2 changed files with 7 additions and 12 deletions

View File

@ -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 {

View File

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