1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-23 03:50:51 +00:00

Update templatefunc.go

This commit is contained in:
guanle 2019-04-21 10:27:35 +08:00 committed by GitHub
parent 3086081ec0
commit fa97488bdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -300,7 +300,12 @@ func parseFormToStruct(form url.Values, objT reflect.Type, objV reflect.Value) e
formValues := form[tag]
var value string
if len(formValues) == 0 {
continue
defaultValue := fieldT.Tag.Get("default")
if defaultValue != "" {
value = defaultValue
} else {
continue
}
}
if len(formValues) == 1 {
value = formValues[0]