错误的
type TestModel struct {
ID int json:"id" gorm:"primaryKey;column:id;type:int(11) auto_increment"
Name string json:"name" gorm:"column:name;type:char(50)"
}
正确的
type TestModel struct {
ID int json:"id" gorm:"primaryKey;column:id;type:int(11);autoIncrement"
Name string json:"name" gorm:"column:name;type:char(50)"
}