I work with Golang and SQL Server. My struct in Golang:
type Role struct {
Id guid.GUID `gorm:"primaryKey;column:Id;type:uniqueidentifier" json:"id"`
RoleName string `gorm:"column:RoleName;not null;unique" json:"roleName"`
IsEnable bool `gorm:"column:IsEnable" json:"isEnable"`
Permissions []RolePermission }
I use gorm to query data but receive error:
unsupported Scan, storing driver.Value type []uint8 into type *guid.GUID.
I used uuid before but the id data is wrong when query (guid to uuid).
Is any way to store and work with Guid using Golang and SQL server