refactor: cleaner way of passing a UDPConn around (#421)

* refactor: cleaner way of passing a UDPConn around

Also part of https://github.com/ooni/probe/issues/1505

* Update internal/engine/netx/quicdialer/connectionstate.go
This commit is contained in:
Simone Basso 2021-07-01 21:56:29 +02:00 committed by GitHub
commit 250a595f89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 33 additions and 27 deletions

View file

@ -12,6 +12,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/lucas-clemente/quic-go"
"github.com/ooni/probe-cli/v3/internal/netxmocks"
"github.com/ooni/probe-cli/v3/internal/quicx"
)
func TestQUICDialerQUICGoCannotSplitHostPort(t *testing.T) {
@ -75,7 +76,7 @@ func TestQUICDialerQUICGoCannotListen(t *testing.T) {
}
systemdialer := QUICDialerQUICGo{
QUICListener: &netxmocks.QUICListener{
MockListen: func(addr *net.UDPAddr) (net.PacketConn, error) {
MockListen: func(addr *net.UDPAddr) (quicx.UDPConn, error) {
return nil, expected
},
},