Fix type conversion in DialUDP function
This commit is contained in:
parent
ffe6ac7161
commit
83bfd6b807
@ -114,6 +114,10 @@ func (s *Dialer) DialContext(ctx context.Context, network string, address string
|
|||||||
|
|
||||||
func (s *Dialer) DialUDP() (net.PacketConn, error) {
|
func (s *Dialer) DialUDP() (net.PacketConn, error) {
|
||||||
conn, err := s.DialContext(context.Background(), "udp", "")
|
conn, err := s.DialContext(context.Background(), "udp", "")
|
||||||
|
if conn == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
return conn.(net.PacketConn), err
|
return conn.(net.PacketConn), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user