mirror of
https://github.com/gin-gonic/gin.git
synced 2025-04-06 03:57:46 +08:00
chore/make initFormCache public #3462
This commit is contained in:
parent
c58e0d59ca
commit
d27b492ba4
@ -377,6 +377,7 @@ People and companies, who have contributed, in alphabetical order.
|
|||||||
- vinhha96 <anhvinha1@gmail.com>
|
- vinhha96 <anhvinha1@gmail.com>
|
||||||
- voidman <retmain@foxmail.com>
|
- voidman <retmain@foxmail.com>
|
||||||
- vz <vzvway@gmail.com>
|
- vz <vzvway@gmail.com>
|
||||||
|
- webstradev <erik@webstra.dev>
|
||||||
- wei <wei840222@gmail.com>
|
- wei <wei840222@gmail.com>
|
||||||
- weibaohui <weibaohui@yeah.net>
|
- weibaohui <weibaohui@yeah.net>
|
||||||
- whirosan <whirosan@users.noreply.github.com>
|
- whirosan <whirosan@users.noreply.github.com>
|
||||||
|
@ -525,7 +525,7 @@ func (c *Context) PostFormArray(key string) (values []string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) initFormCache() {
|
func (c *Context) InitFormCache() {
|
||||||
if c.formCache == nil {
|
if c.formCache == nil {
|
||||||
c.formCache = make(url.Values)
|
c.formCache = make(url.Values)
|
||||||
req := c.Request
|
req := c.Request
|
||||||
@ -541,7 +541,7 @@ func (c *Context) initFormCache() {
|
|||||||
// GetPostFormArray returns a slice of strings for a given form key, plus
|
// 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.
|
// a boolean value whether at least one value exists for the given key.
|
||||||
func (c *Context) GetPostFormArray(key string) (values []string, ok bool) {
|
func (c *Context) GetPostFormArray(key string) (values []string, ok bool) {
|
||||||
c.initFormCache()
|
c.InitFormCache()
|
||||||
values, ok = c.formCache[key]
|
values, ok = c.formCache[key]
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -555,7 +555,7 @@ func (c *Context) PostFormMap(key string) (dicts map[string]string) {
|
|||||||
// GetPostFormMap returns a map for a given form key, plus a boolean value
|
// GetPostFormMap returns a map for a given form key, plus a boolean value
|
||||||
// whether at least one value exists for the given key.
|
// whether at least one value exists for the given key.
|
||||||
func (c *Context) GetPostFormMap(key string) (map[string]string, bool) {
|
func (c *Context) GetPostFormMap(key string) (map[string]string, bool) {
|
||||||
c.initFormCache()
|
c.InitFormCache()
|
||||||
return c.get(c.formCache, key)
|
return c.get(c.formCache, key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user