mirror of
https://github.com/qdm12/gluetun.git
synced 2026-06-20 11:02:59 +02:00
chore(all): replace net.IP with netip.Addr
This commit is contained in:
@@ -7,8 +7,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -31,8 +31,8 @@ type regionData struct {
|
||||
}
|
||||
|
||||
type serverData struct {
|
||||
IP net.IP `json:"ip"`
|
||||
CN string `json:"cn"`
|
||||
IP netip.Addr `json:"ip"`
|
||||
CN string `json:"cn"`
|
||||
}
|
||||
|
||||
func fetchAPI(ctx context.Context, client *http.Client) (
|
||||
|
||||
@@ -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 nameToServer map[string]models.Server
|
||||
|
||||
func (nts nameToServer) add(name, hostname, region string,
|
||||
tcp, udp, portForward bool, ip net.IP) (change bool) {
|
||||
tcp, udp, portForward bool, ip netip.Addr) (change bool) {
|
||||
server, ok := nts[name]
|
||||
if !ok {
|
||||
change = true
|
||||
@@ -32,7 +32,7 @@ func (nts nameToServer) add(name, hostname, region string,
|
||||
|
||||
ipFound := false
|
||||
for _, existingIP := range server.IPs {
|
||||
if ip.Equal(existingIP) {
|
||||
if ip == existingIP {
|
||||
ipFound = true
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user