下面有一段示例代碼,是對用戶的增刪改查:// Create creates a new user account.
func (u *User) Create() error { return DB.Self.Create(&u).Error
}
// Update updates an user account information.
func (u *User) Update() error { return DB.Self.Save(u).Error
}問題:為什么Create(&u)要用取地址,Save(u)要用取值?
- 1 回答
- 0 關(guān)注
- 1610 瀏覽
添加回答
舉報
0/150
提交
取消