From 48708a02aff81d985d36abff03b16f42497e6f54 Mon Sep 17 00:00:00 2001 From: Ethan Koenig Date: Wed, 16 Aug 2017 15:07:06 -0700 Subject: [PATCH] Method to replace all params (#138) --- context.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/context.go b/context.go index dffc50c..94a8c45 100644 --- a/context.go +++ b/context.go @@ -268,6 +268,11 @@ func (ctx *Context) SetParams(name, val string) { ctx.params[name] = val } +// ReplaceAllParams replace all current params with given params +func (ctx *Context) ReplaceAllParams(params Params) { + ctx.params = params; +} + // ParamsEscape returns escapred params result. // e.g. ctx.ParamsEscape(":uname") func (ctx *Context) ParamsEscape(name string) string {