Mapping one type to another
问题 Let's say I have the following types. type Contract struct { Id string `json:"id" gorm:"column:uuid"` Name string `json:"name" gorm:"column:name"` Description string `json:"descr" gorm:"column:descr"` ContractTypeId int `json:"contract_type_id" gorm:"column:contract_type_id"` } type ContractModel struct { Id string `json:"id" gorm:"column:uuid"` Name string `json:"name" gorm:"column:name"` Description string `json:"descr" gorm:"column:descr"` } I have a SQL query using gorm to scan results