diff --git a/mocks/packetconn.go b/mocks/packetconn.go index 9360db4..9f79e10 100644 --- a/mocks/packetconn.go +++ b/mocks/packetconn.go @@ -1,6 +1,9 @@ package mocks -import "net" +import ( + "net" + "time" +) type MockPerfectBiPacketConn struct { directionA chan []byte @@ -44,6 +47,10 @@ func (c MockPerfectPacketConn) LocalAddr() net.Addr { } } +func (c MockPerfectPacketConn) SetReadDeadline(time.Time) error { + return nil +} + func (c MockPerfectPacketConn) ReadFromUDP(b []byte) (int, *net.UDPAddr, error) { p := <-c.inbound return copy(b, p), &net.UDPAddr{ diff --git a/udp/flow_test.go b/udp/flow_test.go index d044477..30a26ea 100644 --- a/udp/flow_test.go +++ b/udp/flow_test.go @@ -64,7 +64,7 @@ func TestFlow_Produce(t *testing.T) { flowA.isAlive = true go func() { - err := flowA.readQueuePacket(context.Background(), testConn.SideB()) + _, err := flowA.readPacket(context.Background(), testConn.SideB()) assert.Nil(t, err) }() p, err := flowA.Produce(context.Background(), testMac)