mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +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
@@ -78,8 +78,8 @@ type NetworkMap struct {
|
||||
// It will neither start nor end with a period.
|
||||
func (nm *NetworkMap) MagicDNSSuffix() string {
|
||||
name := strings.Trim(nm.Name, ".")
|
||||
if i := strings.Index(name, "."); i != -1 {
|
||||
name = name[i+1:]
|
||||
if _, rest, ok := strings.Cut(name, "."); ok {
|
||||
return rest
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
Reference in New Issue
Block a user