You need to add the serializer
tag to specify the serializer that handles how data is serialized and deserialized to and from the database, such as: serializer:json/gob/unixtime
. Since your field is of type JSON, your User
field should be defined as:
User *UserInfo `json:"user" gorm:"serializer:json"`