all: use various net/netip parse funcs directly
Mechanical change with perl+goimports.
Changed {Must,}Parse{IP,IPPrefix,IPPort} to their netip variants, then
goimports -d .
Finally, removed the net/netaddr wrappers, to prevent future use.
Updates #5162
Change-Id: I59c0e38b5fbca5a935d701645789cddf3d7863ad
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
730ca4203c
commit
6a396731eb
@@ -23,18 +23,18 @@ import (
|
||||
|
||||
func ipps(ippStrs ...string) (ipps []netaddr.IPPrefix) {
|
||||
for _, s := range ippStrs {
|
||||
if ip, err := netaddr.ParseIP(s); err == nil {
|
||||
if ip, err := netip.ParseAddr(s); err == nil {
|
||||
ipps = append(ipps, netip.PrefixFrom(ip, ip.BitLen()))
|
||||
continue
|
||||
}
|
||||
ipps = append(ipps, netaddr.MustParseIPPrefix(s))
|
||||
ipps = append(ipps, netip.MustParsePrefix(s))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ips(ss ...string) (ips []netaddr.IP) {
|
||||
for _, s := range ss {
|
||||
ips = append(ips, netaddr.MustParseIP(s))
|
||||
ips = append(ips, netip.MustParseAddr(s))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user