Skip to content

Commit 6d733d3

Browse files
committed
Fixed #1 - Reset context
Signed-off-by: Vishal Rana <[email protected]>
1 parent 6430299 commit 6d733d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

context.go

+4
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ func (c *Context) Get(key string) interface{} {
9494

9595
// Set saves data in the context.
9696
func (c *Context) Set(key string, val interface{}) {
97+
if c.store == nil {
98+
c.store = make(store)
99+
}
97100
c.store[key] = val
98101
}
99102

@@ -180,5 +183,6 @@ func (c *Context) reset(r *http.Request, w http.ResponseWriter, e *Echo) {
180183
c.request = r
181184
c.response.reset(w)
182185
c.query = nil
186+
c.store = nil
183187
c.echo = e
184188
}

0 commit comments

Comments
 (0)