fix TagSettings' map has "":"" value

This commit is contained in:
牛强 2019-04-04 14:35:10 +08:00
parent 8b07437717
commit c0b2317b97

View File

@ -625,6 +625,9 @@ func (scope *Scope) GetStructFields() (fields []*StructField) {
func parseTagSetting(tags reflect.StructTag) map[string]string {
setting := map[string]string{}
for _, str := range []string{tags.Get("sql"), tags.Get("gorm")} {
if str == "" {
continue
}
tags := strings.Split(str, ";")
for _, value := range tags {
v := strings.Split(value, ":")