From 3b7e0b9bdd03b6fcb7f205990cb4cc622c3a0a4e Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Thu, 5 Jan 2023 07:52:29 +0100 Subject: [PATCH] NextLabel: document neg. offset will panic (#1406) Fixes: #1404 Signed-off-by: Miek Gieben Signed-off-by: Miek Gieben --- labels.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/labels.go b/labels.go index f9faacfe..979fccbc 100644 --- a/labels.go +++ b/labels.go @@ -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