chore(all): replace net.IP with netip.Addr
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user