From 5a78885058f5b2f83cd5d8b4a85e1da9b1a9f4a5 Mon Sep 17 00:00:00 2001 From: coder2z <2399158611@qq.com> Date: Sat, 8 May 2021 11:27:40 +0800 Subject: [PATCH] SetQuery SetForm --- context.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/context.go b/context.go index dc03c358..6c7dad68 100644 --- a/context.go +++ b/context.go @@ -440,6 +440,12 @@ func (c *Context) initQueryCache() { } } +// SetQuery Modify or add to the cached Query data +func (c *Context) SetQuery(key,values string) { + c.initQueryCache() + c.queryCache.Set(key,values) +} + // GetQueryArray returns a slice of strings for a given query key, plus // a boolean value whether at least one value exists for the given key. func (c *Context) GetQueryArray(key string) ([]string, bool) { @@ -514,6 +520,12 @@ func (c *Context) initFormCache() { } } +// SetForm Modify or add to the cached Form data +func (c *Context) SetForm(key,values string) { + c.initFormCache() + c.formCache.Set(key,values) +} + // GetPostFormArray returns a slice of strings for a given form key, plus // a boolean value whether at least one value exists for the given key. func (c *Context) GetPostFormArray(key string) ([]string, bool) {