chore(all): replace net.IP with netip.Addr
This commit is contained in:
@@ -3,8 +3,8 @@ package mullvad
|
||||
import (
|
||||
"errors"
|
||||
"math/rand"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
@@ -41,7 +41,7 @@ func Test_Provider_GetConnection(t *testing.T) {
|
||||
},
|
||||
"default OpenVPN TCP port": {
|
||||
filteredServers: []models.Server{
|
||||
{IPs: []net.IP{net.IPv4(1, 1, 1, 1)}},
|
||||
{IPs: []netip.Addr{netip.AddrFrom4([4]byte{1, 1, 1, 1})}},
|
||||
},
|
||||
selection: settings.ServerSelection{
|
||||
OpenVPN: settings.OpenVPNSelection{
|
||||
@@ -50,14 +50,14 @@ func Test_Provider_GetConnection(t *testing.T) {
|
||||
}.WithDefaults(provider),
|
||||
connection: models.Connection{
|
||||
Type: vpn.OpenVPN,
|
||||
IP: net.IPv4(1, 1, 1, 1),
|
||||
IP: netip.AddrFrom4([4]byte{1, 1, 1, 1}),
|
||||
Port: 443,
|
||||
Protocol: constants.TCP,
|
||||
},
|
||||
},
|
||||
"default OpenVPN UDP port": {
|
||||
filteredServers: []models.Server{
|
||||
{IPs: []net.IP{net.IPv4(1, 1, 1, 1)}},
|
||||
{IPs: []netip.Addr{netip.AddrFrom4([4]byte{1, 1, 1, 1})}},
|
||||
},
|
||||
selection: settings.ServerSelection{
|
||||
OpenVPN: settings.OpenVPNSelection{
|
||||
@@ -66,21 +66,21 @@ func Test_Provider_GetConnection(t *testing.T) {
|
||||
}.WithDefaults(provider),
|
||||
connection: models.Connection{
|
||||
Type: vpn.OpenVPN,
|
||||
IP: net.IPv4(1, 1, 1, 1),
|
||||
IP: netip.AddrFrom4([4]byte{1, 1, 1, 1}),
|
||||
Port: 1194,
|
||||
Protocol: constants.UDP,
|
||||
},
|
||||
},
|
||||
"default Wireguard port": {
|
||||
filteredServers: []models.Server{
|
||||
{IPs: []net.IP{net.IPv4(1, 1, 1, 1)}, WgPubKey: "x"},
|
||||
{IPs: []netip.Addr{netip.AddrFrom4([4]byte{1, 1, 1, 1})}, WgPubKey: "x"},
|
||||
},
|
||||
selection: settings.ServerSelection{
|
||||
VPN: vpn.Wireguard,
|
||||
}.WithDefaults(provider),
|
||||
connection: models.Connection{
|
||||
Type: vpn.Wireguard,
|
||||
IP: net.IPv4(1, 1, 1, 1),
|
||||
IP: netip.AddrFrom4([4]byte{1, 1, 1, 1}),
|
||||
Port: 51820,
|
||||
Protocol: constants.UDP,
|
||||
PubKey: "x",
|
||||
|
||||
Reference in New Issue
Block a user