Skip to content
This repository has been archived by the owner on Nov 17, 2019. It is now read-only.

Latest commit

 

History

History
12 lines (8 loc) · 409 Bytes

README.md

File metadata and controls

12 lines (8 loc) · 409 Bytes

删除数据

删除数据Delete方法,参数为struct的指针并且成为查询条件。

user := new(User)
affected, err := engine.Id(id).Delete(user)

Delete的返回值第一个参数为删除的记录数,第二个参数为错误。

注意:当删除时,如果user中包含有bool,float64或者float32类型,有可能会使删除失败。具体请查看 FAQ