MCPcopy
hub / github.com/gin-gonic/gin / iterate

Function iterate

gin.go:397–412  ·  view source on GitHub ↗
(path, method string, routes RoutesInfo, root *node)

Source from the content-addressed store, hash-verified

395}
396
397func iterate(path, method string, routes RoutesInfo, root *node) RoutesInfo {
398 path += root.path
399 if len(root.handlers) > 0 {
400 handlerFunc := root.handlers.Last()
401 routes = append(routes, RouteInfo{
402 Method: method,
403 Path: path,
404 Handler: nameOfFunction(handlerFunc),
405 HandlerFunc: handlerFunc,
406 })
407 }
408 for _, child := range root.children {
409 routes = iterate(path, method, routes, child)
410 }
411 return routes
412}
413
414func (engine *Engine) prepareTrustedCIDRs() ([]*net.IPNet, error) {
415 if engine.trustedProxies == nil {

Callers 1

RoutesMethod · 0.85

Calls 2

nameOfFunctionFunction · 0.85
LastMethod · 0.45

Tested by

no test coverage detected