diff --git a/internal/allocation/allocation_manager_test.go b/internal/allocation/allocation_manager_test.go index 0374bc4f..77c4be11 100644 --- a/internal/allocation/allocation_manager_test.go +++ b/internal/allocation/allocation_manager_test.go @@ -20,6 +20,8 @@ import ( "github.com/stretchr/testify/assert" ) +var errUnexpectedTestUsername = errors.New("unexpected user name") + func TestManager(t *testing.T) { tt := []struct { name string @@ -182,7 +184,7 @@ func newTestManager(expectedUsername string) (*Manager, error) { LeveledLogger: loggerFactory.NewLogger("test"), AllocatePacketConn: func(_ string, _ int, username string) (net.PacketConn, net.Addr, error) { if username != expectedUsername { - return nil, nil, errors.New("unexpected user name") + return nil, nil, errUnexpectedTestUsername } conn, err := net.ListenPacket("udp4", "0.0.0.0:0") if err != nil {