"if" in golang style
This commit is contained in:
parent
263ef914f1
commit
3586dc30c6
@ -73,7 +73,7 @@ func (u *User) BeforeUpdate() (err error) {
|
|||||||
|
|
||||||
// Rollback the insertion if user's id greater than 1000
|
// Rollback the insertion if user's id greater than 1000
|
||||||
func (u *User) AfterCreate() (err error) {
|
func (u *User) AfterCreate() (err error) {
|
||||||
if (u.Id > 1000) {
|
if u.Id > 1000 {
|
||||||
err = errors.New("user id is already greater than 1000")
|
err = errors.New("user id is already greater than 1000")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user