I want to set a value in mux.Vars()
with MatcherFunc
return true, then handlerFun
can access to read.
But panic assignment to entry in nil map when mux.Vars(request)["key"] = "value"
How can I set a value:
domainRouter := router.MatcherFunc(func(request *http.Request, match *mux.RouteMatch) bool {
if isOk {
mux.Vars(request)["key"] = "value"
return true
}
return false
}).Subrouter()