mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 17:50:58 +00:00
Update templatefunc.go
This commit is contained in:
parent
3086081ec0
commit
fa97488bdc
@ -300,8 +300,13 @@ func parseFormToStruct(form url.Values, objT reflect.Type, objV reflect.Value) e
|
|||||||
formValues := form[tag]
|
formValues := form[tag]
|
||||||
var value string
|
var value string
|
||||||
if len(formValues) == 0 {
|
if len(formValues) == 0 {
|
||||||
|
defaultValue := fieldT.Tag.Get("default")
|
||||||
|
if defaultValue != "" {
|
||||||
|
value = defaultValue
|
||||||
|
} else {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if len(formValues) == 1 {
|
if len(formValues) == 1 {
|
||||||
value = formValues[0]
|
value = formValues[0]
|
||||||
if value == "" {
|
if value == "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user