diff --git a/wgengine/magicsock/magicsock_test.go b/wgengine/magicsock/magicsock_test.go index 7caca8136..a98d48a45 100644 --- a/wgengine/magicsock/magicsock_test.go +++ b/wgengine/magicsock/magicsock_test.go @@ -453,7 +453,7 @@ func makeConfigs(t *testing.T, addrs []netaddr.IPPort) []wgcfg.Config { privKeys = append(privKeys, wgkey.Private(privKey)) addresses = append(addresses, []netaddr.IPPrefix{ - parseCIDR(t, fmt.Sprintf("1.0.0.%d/32", i+1)), + netaddr.MustParseIPPrefix(fmt.Sprintf("1.0.0.%d/32", i+1)), }) } @@ -481,15 +481,6 @@ func makeConfigs(t *testing.T, addrs []netaddr.IPPort) []wgcfg.Config { return cfgs } -func parseCIDR(t *testing.T, addr string) netaddr.IPPrefix { - t.Helper() - cidr, err := netaddr.ParseIPPrefix(addr) - if err != nil { - t.Fatal(err) - } - return cidr -} - // TestDeviceStartStop exercises the startup and shutdown logic of // wireguard-go, which is intimately intertwined with magicsock's own // lifecycle. We seem to be good at generating deadlocks here, so if