chore(all): replace net.IP with netip.Addr

This commit is contained in:
Quentin McGaw
2023-05-20 19:58:18 +00:00
parent 00ee6ff9a7
commit 0a29337c3b
91 changed files with 525 additions and 590 deletions

View File

@@ -3,7 +3,7 @@ package expressvpn
import (
"errors"
"math/rand"
"net"
"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{
@@ -52,7 +52,7 @@ func Test_Provider_GetConnection(t *testing.T) {
},
"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{
@@ -61,14 +61,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: 1195,
Protocol: constants.UDP,
},
},
"default Wireguard 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{
VPN: vpn.Wireguard,