'not compatible with reflect.StructTag.Get
I was working in Google CLoud and all was fine.. but when I clone all my project in my PC, I have this messages in every JSON struct.
struct field tag bson:"edad" json:"edad, omitempty"
not compatible with reflect.StructTag.Get: suspicious space in struct tag valuestructtag
This is my Struct
type Usuario struct {
ID bson.RawValue `bson:"_id" json:"id, omitempty"`
Nombre string `bson:"nombre" json:"nombre, omitempty"`
Apellidos string `bson:"apellidos" json:"apellidos, omitempty"`
Edad int `bson:"edad" json:"edad, omitempty"`
Email string `bson:"email" json:"email"`
Password string `bson:"password" json:"password, omitempty"`
}
What's wrong ?
Thanks
Solution 1:[1]
You are missing a space after the comma before omitempty
, correct that and there will no longer be an error message.
bson:"password" json:"password,omitempty"
(should be like this)
In addition, this is a warning not an error. You should still be able to run your project.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Michael |