Fix type conversion in DialUDP function

This commit is contained in:
Anton Zadvorny 2021-07-12 20:22:09 +03:00
parent ffe6ac7161
commit 83bfd6b807

View File

@ -114,6 +114,10 @@ func (s *Dialer) DialContext(ctx context.Context, network string, address string
func (s *Dialer) DialUDP() (net.PacketConn, error) {
conn, err := s.DialContext(context.Background(), "udp", "")
if conn == nil {
return nil, err
}
return conn.(net.PacketConn), err
}