From 071b657418cccdab721e549108b6b6cf8a1b7361 Mon Sep 17 00:00:00 2001 From: Jony4 Date: Fri, 5 Apr 2019 08:00:48 +0800 Subject: [PATCH] fix TagSettings' map has "":"" value (#2372) --- model_struct.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/model_struct.go b/model_struct.go index 9e93db63..194bcfdc 100644 --- a/model_struct.go +++ b/model_struct.go @@ -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, ":")