Skip to content

Commit 4ea43e0

Browse files
committed
Add *Context.Del method
1 parent 5e3c045 commit 4ea43e0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

context_input.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ func (ctx *Context) SetData(key, val interface{}) {
269269
ctx.data[key] = val
270270
}
271271

272+
// Del delete data by key.
273+
func (ctx *Context) Del(key interface{}) {
274+
delete(ctx.data, key)
275+
}
276+
272277
// Param returns the first value for the kinds of parameters.
273278
// priority:
274279
// path parameters > POST and PUT body parameters > URL query string values > header > cookie.Value.

0 commit comments

Comments
 (0)