MCPcopy
hub / github.com/gorilla/mux / prepareVars

Method prepareVars

route.go:752–758  ·  view source on GitHub ↗

prepareVars converts the route variable pairs into a map. If the route has a BuildVarsFunc, it is invoked.

(pairs ...string)

Source from the content-addressed store, hash-verified

750// prepareVars converts the route variable pairs into a map. If the route has a
751// BuildVarsFunc, it is invoked.
752func (r *Route) prepareVars(pairs ...string) (map[string]string, error) {
753 m, err := mapFromPairsToString(pairs...)
754 if err != nil {
755 return nil, err
756 }
757 return r.buildVars(m), nil
758}
759
760func (r *Route) buildVars(m map[string]string) map[string]string {
761 if r.buildVarsFunc != nil {

Callers 3

URLMethod · 0.95
URLHostMethod · 0.95
URLPathMethod · 0.95

Calls 2

buildVarsMethod · 0.95
mapFromPairsToStringFunction · 0.85

Tested by

no test coverage detected