"if" in golang style (#1679)

This commit is contained in:
Sergey Lanzman 2018-01-31 11:06:57 +02:00 committed by Jinzhu
parent d2dfb7d0fb
commit 04dd90a8da

View File

@ -73,7 +73,7 @@ func (u *User) BeforeUpdate() (err error) {
// Rollback the insertion if user's id greater than 1000
func (u *User) AfterCreate() (err error) {
if (u.Id > 1000) {
if u.Id > 1000 {
err = errors.New("user id is already greater than 1000")
}
return