diff --git a/tsnet/example/tshello/tshello.go b/tsnet/example/tshello/tshello.go index 33db9f0bc..16131ef8a 100644 --- a/tsnet/example/tshello/tshello.go +++ b/tsnet/example/tshello/tshello.go @@ -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 }