mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-18 06:42:10 +08:00
fix discussion
This commit is contained in:
parent
dc8d66c077
commit
673f3fabcb
@ -158,15 +158,9 @@ func setByForm(value reflect.Value, field reflect.StructField, form map[string][
|
||||
}
|
||||
return true, setArray(vs, value, field)
|
||||
default:
|
||||
var val string
|
||||
if !ok {
|
||||
val = opt.defaultValue
|
||||
}
|
||||
|
||||
val := opt.defaultValue
|
||||
if len(vs) > 0 && vs[0] != "" {
|
||||
val = vs[0]
|
||||
} else {
|
||||
val = opt.defaultValue
|
||||
}
|
||||
return true, setWithProperType(val, value, field)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user