mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 17:50:58 +00:00
删除Param中的断言
This commit is contained in:
parent
860006bfda
commit
ff92f22d84
@ -272,13 +272,8 @@ func (b *BeegoHttpRequest) SetProxy(proxy func(*http.Request) (*url.URL, error))
|
|||||||
|
|
||||||
// Param adds query param in to request.
|
// Param adds query param in to request.
|
||||||
// params build query string as ?key1=value1&key2=value2...
|
// params build query string as ?key1=value1&key2=value2...
|
||||||
func (b *BeegoHttpRequest) Param(key, value interface{}) *BeegoHttpRequest {
|
func (b *BeegoHttpRequest) Param(key string, value interface{}) *BeegoHttpRequest {
|
||||||
switch value.(type) {
|
b.params[key] = value
|
||||||
case string:
|
|
||||||
b.params[key.(string)] = value.(string)
|
|
||||||
case []string:
|
|
||||||
b.params[key.(string)] = value.([]string)
|
|
||||||
}
|
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user