Skip to content

Commit

Permalink
NextLabel: document neg. offset will panic (#1406)
Browse files Browse the repository at this point in the history
Fixes: #1404

Signed-off-by: Miek Gieben <miek@miek.nl>

Signed-off-by: Miek Gieben <miek@miek.nl>
  • Loading branch information
miekg committed Jan 5, 2023
1 parent 8c643eb commit 3b7e0b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ func Split(s string) []int {
}

// 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.
// Also see PrevLabel.

func NextLabel(s string, offset int) (i int, end bool) {
if s == "" {
return 0, true
Expand Down

0 comments on commit 3b7e0b9

Please sign in to comment.