Skip to content

Commit

Permalink
add func AllParams() for Context
Browse files Browse the repository at this point in the history
It is usefull with for-each.
  • Loading branch information
xmh19936688 committed Feb 24, 2020
1 parent 993bb1c commit b267c67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions context.go
Expand Up @@ -260,6 +260,11 @@ func (ctx *Context) Params(name string) string {
return ctx.params[name]
}

// AllParams returns all params.
func (ctx *Context) AllParams() Params {
return ctx.params
}

// SetParams sets value of param with given name.
func (ctx *Context) SetParams(name, val string) {
if name != "*" && !strings.HasPrefix(name, ":") {
Expand Down

0 comments on commit b267c67

Please sign in to comment.