gin-gonic / gin

Compare 2d3d6d2 ... +0 ... eb75ce0

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.

Showing 1 of 1 files from the diff.

@@ -14,6 +14,13 @@
Loading
14 14
var (
15 15
	// reg match english letters for http method name
16 16
	regEnLetter = regexp.MustCompile("^[A-Z]+$")
17 +
18 +
	// anyMethods for RouterGroup Any method
19 +
	anyMethods = []string{
20 +
		http.MethodGet, http.MethodPost, http.MethodPut, http.MethodPatch,
21 +
		http.MethodHead, http.MethodOptions, http.MethodDelete, http.MethodConnect,
22 +
		http.MethodTrace,
23 +
	}
17 24
)
18 25
19 26
// IRouter defines all router handle interface includes single and group router.
@@ -136,15 +143,10 @@
Loading
136 143
// Any registers a route that matches all the HTTP methods.
137 144
// GET, POST, PUT, PATCH, HEAD, OPTIONS, DELETE, CONNECT, TRACE.
138 145
func (group *RouterGroup) Any(relativePath string, handlers ...HandlerFunc) IRoutes {
139 -
	group.handle(http.MethodGet, relativePath, handlers)
140 -
	group.handle(http.MethodPost, relativePath, handlers)
141 -
	group.handle(http.MethodPut, relativePath, handlers)
142 -
	group.handle(http.MethodPatch, relativePath, handlers)
143 -
	group.handle(http.MethodHead, relativePath, handlers)
144 -
	group.handle(http.MethodOptions, relativePath, handlers)
145 -
	group.handle(http.MethodDelete, relativePath, handlers)
146 -
	group.handle(http.MethodConnect, relativePath, handlers)
147 -
	group.handle(http.MethodTrace, relativePath, handlers)
146 +
	for _, method := range anyMethods {
147 +
		group.handle(method, relativePath, handlers)
148 +
	}
149 +
148 150
	return group.returnObj()
149 151
}
150 152

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
binding 100.00%
render 92.61%
auth.go 100.00%
context.go 97.81%
debug.go 100.00%
deprecated.go 100.00%
errors.go 100.00%
fs.go 100.00%
gin.go 99.12%
logger.go 100.00%
mode.go 100.00%
path.go 100.00%
recovery.go 98.08%
response_writer.go 93.48%
routergroup.go 100.00%
test_helpers.go 100.00%
tree.go 100.00%
utils.go 96.81%
Project Totals (41 files) 98.73%
Loading