diff --git a/matching.go b/matching.go index 7843279..42da160 100644 --- a/matching.go +++ b/matching.go @@ -176,7 +176,7 @@ func FindNthMatch(regex Reg, str string, n int) (Match, error) { } } // We haven't found the nth match after scanning the string - Return an error - return nil, fmt.Errorf("Invalid match index. Too few matches found.") + return nil, fmt.Errorf("invalid match index - too few matches found") } // FindAllMatches tries to find all matches of the regex represented by given start-state, with diff --git a/sliceQueue.go b/sliceQueue.go index 1ef6f07..ecb32f6 100644 --- a/sliceQueue.go +++ b/sliceQueue.go @@ -5,7 +5,7 @@ import "errors" // Helper functions for slices, to make them behave more like stacks func peek[T any](s []T) (T, error) { if len(s) < 1 { - return *new(T), errors.New("Stack empty") + return *new(T), errors.New("stack empty") } return s[len(s)-1], nil } @@ -20,7 +20,7 @@ func mustPop[T any](sp *[]T) T { func pop[T any](sp *[]T) (T, error) { if len(*sp) < 1 { - return *new(T), errors.New("Stack empty") + return *new(T), errors.New("stack empty") } to_return := (*sp)[len(*sp)-1] *sp = (*sp)[:len(*sp)-1]