tsnet/example/tshello: use strings.Cut (#6198)

strings.Cut allows us to be more precise here. This example was written
before strings.Cut existed.

Signed-off-by: Xe <xe@tailscale.com>

Signed-off-by: Xe <xe@tailscale.com>
pull/6220/head
Xe Iaso 2 years ago committed by GitHub
parent c2d7940ec0
commit be7556aece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -57,8 +57,6 @@ func main() {
}
func firstLabel(s string) string {
if i := strings.Index(s, "."); i != -1 {
return s[:i]
}
s, _, _ = strings.Cut(s, ".")
return s
}

Loading…
Cancel
Save