Go 1.20 will require Go 1.17 to bootstrap, so we can stop worrying about
older Go bootstrap versions. https://go.dev/issues/44505 fixed most of
those TODOs, but this one was presumably forgotten about.
Change-Id: I0c19ec4eec65cd807e7db9a57c5969845d915c07
Reviewed-on: https://go-review.googlesource.com/c/go/+/461155
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
if i < 0 {
return name, "", ""
}
- // TODO: use LastIndexByte once the bootstrap compiler is >= Go 1.5.
- j := len(name) - 1
- for j > i && name[j] != ']' {
- j--
- }
+ j := strings.LastIndexByte(name, ']')
if j <= i {
return name, "", ""
}