Skip to content

Commit 3f579cc

Browse files
SAPRD2daveshanley
authored andcommitted
remove printf error
1 parent 4ab7e54 commit 3f579cc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

helpers/regex_maker.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func GetRegexForPath(tpl string) (*regexp.Regexp, error) {
3737

3838
// Name or pattern can't be empty.
3939
if name == "" || patt == "" {
40-
return nil, fmt.Errorf("mux: missing name or pattern in %q", tpl[idxs[i]:end])
40+
return nil, fmt.Errorf("missing name or pattern in %q", tpl[idxs[i]:end])
4141
}
4242

4343
// Build the regexp pattern.
@@ -62,7 +62,7 @@ func GetRegexForPath(tpl string) (*regexp.Regexp, error) {
6262

6363
// Check for capturing groups which used to work in older versions
6464
if reg.NumSubexp() != len(idxs)/2 {
65-
return nil, fmt.Errorf(fmt.Sprintf("route %s contains capture groups in its regexp. ", template) + "Only non-capturing groups are accepted: e.g. (?:pattern) instead of (pattern)")
65+
return nil, fmt.Errorf("route %s contains capture groups in its regexp. Only non-capturing groups are accepted: e.g. (?:pattern) instead of (pattern)", template)
6666
}
6767

6868
// Done!
@@ -82,12 +82,12 @@ func BraceIndices(s string) ([]int, error) {
8282
if level--; level == 0 {
8383
idxs = append(idxs, idx, i+1)
8484
} else if level < 0 {
85-
return nil, fmt.Errorf("mux: unbalanced braces in %q", s)
85+
return nil, fmt.Errorf("unbalanced braces in %q", s)
8686
}
8787
}
8888
}
8989
if level != 0 {
90-
return nil, fmt.Errorf("mux: unbalanced braces in %q", s)
90+
return nil, fmt.Errorf("unbalanced braces in %q", s)
9191
}
9292
return idxs, nil
9393
}

0 commit comments

Comments
 (0)