diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-11-05 01:52:54 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-11-06 14:30:50 +0100 |
commit | 23d4e52ac97fc7e4e7c47d4e277693c516c3b420 (patch) | |
tree | 37fde134306c70b993147062694333bf5b99837d /device/device_test.go | |
parent | 851efb1bb65555e0f765a3361c8eb5ac47435b19 (diff) | |
download | wireguard-go-23d4e52ac97fc7e4e7c47d4e277693c516c3b420.tar.gz wireguard-go-23d4e52ac97fc7e4e7c47d4e277693c516c3b420.zip |
global: use netip where possible now
There are more places where we'll need to add it later, when Go 1.18
comes out with support for it in the "net" package. Also, allowedips
still uses slices internally, which might be suboptimal.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/device_test.go')
-rw-r--r-- | device/device_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/device/device_test.go b/device/device_test.go index 29daeb9..84221be 100644 --- a/device/device_test.go +++ b/device/device_test.go @@ -11,7 +11,6 @@ import ( "fmt" "io" "math/rand" - "net" "runtime" "runtime/pprof" "sync" @@ -19,6 +18,7 @@ import ( "testing" "time" + "golang.zx2c4.com/go118/netip" "golang.zx2c4.com/wireguard/conn" "golang.zx2c4.com/wireguard/conn/bindtest" "golang.zx2c4.com/wireguard/tun/tuntest" @@ -96,7 +96,7 @@ type testPair [2]testPeer type testPeer struct { tun *tuntest.ChannelTUN dev *Device - ip net.IP + ip netip.Addr } type SendDirection bool @@ -159,7 +159,7 @@ func genTestPair(tb testing.TB, realSocket bool) (pair testPair) { for i := range pair { p := &pair[i] p.tun = tuntest.NewChannelTUN() - p.ip = net.IPv4(1, 0, 0, byte(i+1)) + p.ip = netip.AddrFrom4([4]byte{1, 0, 0, byte(i + 1)}) level := LogLevelVerbose if _, ok := tb.(*testing.B); ok && !testing.Verbose() { level = LogLevelError |