diff --git a/context.go b/context.go index 9eacd449..87078408 100644 --- a/context.go +++ b/context.go @@ -198,11 +198,9 @@ type ( pvalues []string query url.Values handler HandlerFunc - store store + store Map echo *Echo } - - store map[string]interface{} ) const ( @@ -349,7 +347,7 @@ func (c *context) Cookies() []*http.Cookie { func (c *context) Set(key string, val interface{}) { if c.store == nil { - c.store = make(store) + c.store = make(Map) } c.store[key] = val } diff --git a/echo.go b/echo.go index e095a913..4d7b72d8 100644 --- a/echo.go +++ b/echo.go @@ -118,6 +118,9 @@ type ( Renderer interface { Render(io.Writer, string, interface{}, Context) error } + + // Map defines a generic map of type `map[string]interface{}`. + Map map[string]interface{} ) // HTTP methods @@ -265,7 +268,7 @@ func (e *Echo) NewContext(r *http.Request, w http.ResponseWriter) Context { return &context{ request: r, response: NewResponse(w, e), - store: make(store), + store: make(Map), echo: e, pvalues: make([]string, *e.maxParam), handler: NotFoundHandler,