Seems to have missed the strings.Cut* family added to go 1.18
// excerpted from Cut
if i := Index(s, sep); i >= 0 {
return s[:i], s[i+len(sep):], true
}
return s, "", false
Then why shouldn't this also not allocate? eoc = strings.Index(round, ", ")
if eoc == -1 {
currentScoreWithColor = round
} else {
currentScoreWithColor = round[:eoc]
round = round[eoc+2:]
}
Edit: oh, you're comparing it to Split. I was comparing it to what they ended up implementing.