mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-18 05:18:23 +00:00
all: use strings.Cut even more
Change-Id: I943ce72c6f339589235bddbe10d07799c4e37979 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
f30473211b
commit
f2041c9088
@@ -188,8 +188,8 @@ func peerDebugName(p *tailcfg.Node) string {
|
||||
return ""
|
||||
}
|
||||
n := p.Name
|
||||
if i := strings.Index(n, "."); i != -1 {
|
||||
return n[:i]
|
||||
if base, _, ok := strings.Cut(n, "."); ok {
|
||||
return base
|
||||
}
|
||||
return p.Hostinfo.Hostname()
|
||||
}
|
||||
|
Reference in New Issue
Block a user