NextLabel: document neg. offset will panic (#1406)
Fixes: #1404 Signed-off-by: Miek Gieben <miek@miek.nl> Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
parent
8c643eba82
commit
3b7e0b9bdd
|
@ -122,9 +122,10 @@ func Split(s string) []int {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NextLabel returns the index of the start of the next label in the
|
// NextLabel returns the index of the start of the next label in the
|
||||||
// string s starting at offset.
|
// string s starting at offset. A negative offset will cause a panic.
|
||||||
// The bool end is true when the end of the string has been reached.
|
// The bool end is true when the end of the string has been reached.
|
||||||
// Also see PrevLabel.
|
// Also see PrevLabel.
|
||||||
|
|
||||||
func NextLabel(s string, offset int) (i int, end bool) {
|
func NextLabel(s string, offset int) (i int, end bool) {
|
||||||
if s == "" {
|
if s == "" {
|
||||||
return 0, true
|
return 0, true
|
||||||
|
|
Loading…
Reference in New Issue