chore(all): replace net.IP with netip.Addr
This commit is contained in:
@@ -5,8 +5,8 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -26,8 +26,8 @@ type logicalServer struct {
|
||||
}
|
||||
|
||||
type physicalServer struct {
|
||||
EntryIP net.IP
|
||||
ExitIP net.IP
|
||||
EntryIP netip.Addr
|
||||
ExitIP netip.Addr
|
||||
Domain string
|
||||
Status uint8
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package updater
|
||||
|
||||
import (
|
||||
"net"
|
||||
"net/netip"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/vpn"
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
type ipToServer map[string]models.Server
|
||||
|
||||
func (its ipToServer) add(country, region, city, name, hostname string,
|
||||
free bool, entryIP net.IP) {
|
||||
free bool, entryIP netip.Addr) {
|
||||
key := entryIP.String()
|
||||
|
||||
server, ok := its[key]
|
||||
@@ -27,7 +27,7 @@ func (its ipToServer) add(country, region, city, name, hostname string,
|
||||
server.Free = free
|
||||
server.UDP = true
|
||||
server.TCP = true
|
||||
server.IPs = []net.IP{entryIP}
|
||||
server.IPs = []netip.Addr{entryIP}
|
||||
its[key] = server
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user