mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-18 23:12:17 +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)
|
return true, setArray(vs, value, field)
|
||||||
default:
|
default:
|
||||||
var val string
|
val := opt.defaultValue
|
||||||
if !ok {
|
|
||||||
val = opt.defaultValue
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(vs) > 0 && vs[0] != "" {
|
if len(vs) > 0 && vs[0] != "" {
|
||||||
val = vs[0]
|
val = vs[0]
|
||||||
} else {
|
|
||||||
val = opt.defaultValue
|
|
||||||
}
|
}
|
||||||
return true, setWithProperType(val, value, field)
|
return true, setWithProperType(val, value, field)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user