chore(wireguard): use netip.AddrPort instead of *net.UDPAddr

This commit is contained in:
Quentin McGaw
2023-05-20 20:05:40 +00:00
parent 0a29337c3b
commit 86ec75722a
7 changed files with 42 additions and 99 deletions

View File

@@ -1,7 +1,6 @@
package utils
import (
"net"
"net/netip"
"testing"
@@ -43,10 +42,7 @@ func Test_BuildWireguardSettings(t *testing.T) {
PrivateKey: "private",
PublicKey: "public",
PreSharedKey: "pre-shared",
Endpoint: &net.UDPAddr{
IP: net.IP{1, 2, 3, 4},
Port: 51821,
},
Endpoint: netip.AddrPortFrom(netip.AddrFrom4([4]byte{1, 2, 3, 4}), 51821),
Addresses: []netip.Prefix{
netip.PrefixFrom(netip.AddrFrom4([4]byte{1, 1, 1, 1}), 32),
},