gin-gonic / gin

Compare 7313b8f ... +0 ... f1da692

Showing 1 of 1 files from the diff.

@@ -11,6 +11,11 @@
Loading
11 11
	"strings"
12 12
)
13 13
14 +
var (
15 +
	// reg match english letters for http method name
16 +
	regEnLetter = regexp.MustCompile("^[A-Z]+$")
17 +
)
18 +
14 19
// IRouter defines all router handle interface includes single and group router.
15 20
type IRouter interface {
16 21
	IRoutes
@@ -87,7 +92,7 @@
Loading
87 92
// frequently used, non-standardized or custom methods (e.g. for internal
88 93
// communication with a proxy).
89 94
func (group *RouterGroup) Handle(httpMethod, relativePath string, handlers ...HandlerFunc) IRoutes {
90 -
	if matches, err := regexp.MatchString("^[A-Z]+$", httpMethod); !matches || err != nil {
95 +
	if matched := regEnLetter.MatchString(httpMethod); !matched {
91 96
		panic("http method " + httpMethod + " is not valid")
92 97
	}
93 98
	return group.handle(httpMethod, relativePath, handlers)

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
Project Totals (41 files) 98.67%
Loading