MCPcopy
hub / github.com/julienschmidt/httprouter / New

Function New

router.go:192–199  ·  router.go::New

New returns a new initialized Router. Path auto-correction, including trailing slashes, is enabled by default.

()

Source from the content-addressed store, hash-verified

190// New returns a new initialized Router.
191// Path auto-correction, including trailing slashes, is enabled by default.
192func New() *Router {
193 return &Router{
194 RedirectTrailingSlash: true,
195 RedirectFixedPath: true,
196 HandleMethodNotAllowed: true,
197 HandleOPTIONS: true,
198 }
199}
200
201// GET is a shortcut for router.Handle(http.MethodGet, path, handle)
202func (r *Router) GET(path string, handle Handle) {

Callers 13

router.goFile · 0.85
TestRouterFunction · 0.85
TestRouterAPIFunction · 0.85
TestRouterRootFunction · 0.85
TestRouterChainingFunction · 0.85
BenchmarkAllowedFunction · 0.85
TestRouterOPTIONSFunction · 0.85
TestRouterNotAllowedFunction · 0.85
TestRouterNotFoundFunction · 0.85
TestRouterPanicHandlerFunction · 0.85
TestRouterLookupFunction · 0.85

Calls

no outgoing calls

Tested by 12

TestRouterFunction · 0.68
TestRouterAPIFunction · 0.68
TestRouterRootFunction · 0.68
TestRouterChainingFunction · 0.68
BenchmarkAllowedFunction · 0.68
TestRouterOPTIONSFunction · 0.68
TestRouterNotAllowedFunction · 0.68
TestRouterNotFoundFunction · 0.68
TestRouterPanicHandlerFunction · 0.68
TestRouterLookupFunction · 0.68
TestRouterServeFilesFunction · 0.68