Export NewContext

This commit is contained in:
Nise Void 2020-04-09 10:41:23 +02:00
parent d504c9d2b5
commit 5b5a102c71
Signed by: NiseVoid
GPG key ID: FBA14AC83EA602F3
2 changed files with 4 additions and 5 deletions

View file

@ -20,7 +20,8 @@ type Context struct {
store map[string]interface{}
}
func newContext(router *Router, res http.ResponseWriter, req *http.Request, param httprouter.Params) *Context {
// NewContext creates a new context, this function is only exported for use in tests
func NewContext(router *Router, res http.ResponseWriter, req *http.Request, param httprouter.Params) *Context {
return &Context{router, req, res, param.ByName, make(map[string]interface{})}
}