MCPcopy
hub / github.com/go-chi/chi / NewMux

Function NewMux

mux.go:52–58  ·  view source on GitHub ↗

NewMux returns a newly initialized Mux object that implements the Router interface.

()

Source from the content-addressed store, hash-verified

50// NewMux returns a newly initialized Mux object that implements the Router
51// interface.
52func NewMux() *Mux {
53 mux := &Mux{tree: &node{}, pool: &sync.Pool{}}
54 mux.pool.New = func() interface{} {
55 return NewRouteContext()
56 }
57 return mux
58}
59
60// ServeHTTP is the single method of the http.Handler interface that makes
61// Mux interoperable with the standard library. It uses a sync.Pool to get and

Callers 2

NewRouterFunction · 0.85

Calls 1

NewRouteContextFunction · 0.85

Tested by 1