mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-24 09:39:39 +00:00
all: use Go 1.18's strings.Cut
More remain. Change-Id: I6ec562cc1f687600758deae1c9d7dbd0d04004cb Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
1f22507c06
commit
61ee72940c
@@ -114,8 +114,7 @@ func parseIPSet(arg string, bits *int) ([]netaddr.IPPrefix, error) {
|
||||
return []netaddr.IPPrefix{pfx}, nil
|
||||
}
|
||||
if strings.Count(arg, "-") == 1 {
|
||||
i := strings.Index(arg, "-")
|
||||
ip1s, ip2s := arg[:i], arg[i+1:]
|
||||
ip1s, ip2s, _ := strings.Cut(arg, "-")
|
||||
ip1, err := netaddr.ParseIP(ip1s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user