I have the following struct defined:
type User struct {
gorm.Model
FirstName string `json:"first_name" gorm:"type:varchar(32); not null" binding:"required"`
LastName string `json:"last_name" gorm:"type:varchar(32)"`
MiddleName string `json:"middle_name" gorm:"type:varchar(32)"`
NickName string `json:"nick_name" gorm:"type:varchar(16)"`
BirthDate time.Time `json:"birth_date" gorm:"not null" binding:"required"`
MobileNumber string `json:"mobile_number" gorm:"size:16" binding:"required"`
EmailAddresses []EmailAddress `json:email_addresses`
}
and
type EmailAddress struct {
gorm.Model
UserID uint
EmailAddress string `json:"email_address" gorm:"type:varchar(320); not null; unique" binding:"required"`
Code string
CodeGeneratedAt time.Time
CodeVerifiedAt time.Time
Active bool
}
May I ask how to get rid of this linter warning in VSCode that appears in the User
struct EmailAddresses []EmailAddress `json:email_addresses`
property?
Linter Warning:
struct field tag `json:email_addresses` not compatible with reflect.StructTag.Get: bad syntax for struct tag value
Thanks in advance for your help.