forked from mirror/gorm
fix TagSettings' map has "":"" value (#2372)
This commit is contained in:
parent
bc5d3f07a8
commit
071b657418
|
@ -625,6 +625,9 @@ func (scope *Scope) GetStructFields() (fields []*StructField) {
|
||||||
func parseTagSetting(tags reflect.StructTag) map[string]string {
|
func parseTagSetting(tags reflect.StructTag) map[string]string {
|
||||||
setting := map[string]string{}
|
setting := map[string]string{}
|
||||||
for _, str := range []string{tags.Get("sql"), tags.Get("gorm")} {
|
for _, str := range []string{tags.Get("sql"), tags.Get("gorm")} {
|
||||||
|
if str == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
tags := strings.Split(str, ";")
|
tags := strings.Split(str, ";")
|
||||||
for _, value := range tags {
|
for _, value := range tags {
|
||||||
v := strings.Split(value, ":")
|
v := strings.Split(value, ":")
|
||||||
|
|
Loading…
Reference in New Issue