From 465f8ea05b5638e508d29985eed6615402a9c2eb Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Mon, 2 May 2016 19:34:11 +0800 Subject: [PATCH] Fix ignore fields --- model_struct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model_struct.go b/model_struct.go index 6df615d1..c1885eae 100644 --- a/model_struct.go +++ b/model_struct.go @@ -157,7 +157,7 @@ func (scope *Scope) GetModelStruct() *ModelStruct { } // is ignored field - if fieldStruct.Tag.Get("sql") == "-" { + if _, ok := field.TagSettings["-"]; ok { field.IsIgnored = true } else { if _, ok := field.TagSettings["PRIMARY_KEY"]; ok {