gin-gonic / gin
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
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%
1376761732
nomsgpack go-1.14 macos-latest
1376761732
go-1.15 macos-latest
1376761732
nomsgpack go-1.15 macos-latest
1376761732
nomsgpack go-1.13 macos-latest
1376761732
go-1.16 macos-latest
1376761732
nomsgpack go-1.16 macos-latest
1376761732
nomsgpack go-1.17 macos-latest
1376761732
go-1.17 macos-latest
1376761732
go-1.13 macos-latest
1376761732
go-1.14 macos-latest
1376761732
go-1.17 ubuntu-latest
1376761732
nomsgpack go-1.13 ubuntu-latest
1376761732
go-1.13 ubuntu-latest
1376761732
nomsgpack go-1.15 ubuntu-latest
1376761732
nomsgpack go-1.14 ubuntu-latest
1376761732
nomsgpack go-1.17 ubuntu-latest
1376761732
go-1.16 ubuntu-latest
1376761732
go-1.15 ubuntu-latest
1376761732
nomsgpack go-1.16 ubuntu-latest
1376761732
go-1.14 ubuntu-latest
1
coverage:
2
  notify:
3
    gitter:
4
      default:
5
        url: https://webhooks.gitter.im/e/d90dcdeeab2f1e357165
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading