From dd45f63209a8e51979b11182253ee80b5289c10a Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 25 Oct 2018 19:25:10 +0200 Subject: Drop Version, make lint happy --- re.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 're.go') diff --git a/re.go b/re.go index 4d3fa48..fab6386 100644 --- a/re.go +++ b/re.go @@ -6,17 +6,17 @@ import ( "strings" ) -var ErrNotRE = errors.New("not re") +var errNotRE = errors.New("not re") func re(s, r string, global bool) (string, error) { // min: at least two separators if len(r) < 2 { - return "", ErrNotRE + return "", errNotRE } z := strings.Split(r[1:], string(r[0])) // match // and /// if len(z) < 2 || len(z) > 3 { - return "", ErrNotRE + return "", errNotRE } re, err := regexp.Compile(z[0]) if err != nil { @@ -28,7 +28,7 @@ func re(s, r string, global bool) (string, error) { } return re.ReplaceAllStringFunc(s, func(b string) string { if i != 0 { - i -= 1 + i-- return z[1] } return b -- cgit v1.2.3