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>
This commit is contained in:
Xe Iaso 2022-11-07 15:06:34 -05:00 committed by GitHub
parent c2d7940ec0
commit be7556aece
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}