From 3836f5441e06feecdf759c74c65e8c333843bf6b Mon Sep 17 00:00:00 2001 From: Andy Ruland Date: Sun, 12 Jun 2016 07:08:32 +0400 Subject: [PATCH] Added working syntax to ignore field Replaced non-working `gorm:"-"` syntax with `sql:"-"` to ignore a field in a struct --- documents/models.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documents/models.md b/documents/models.md index 61706824..259ed599 100644 --- a/documents/models.md +++ b/documents/models.md @@ -21,7 +21,7 @@ type User struct { ShippingAddress Address // One-To-One relationship (belongs to - use ShippingAddressID as foreign key) ShippingAddressID int - IgnoreMe int `gorm:"-"` // Ignore this field + IgnoreMe int `sql:"-"` // Ignore this field Languages []Language `gorm:"many2many:user_languages;"` // Many-To-Many relationship, 'user_languages' is join table }