Created
January 19, 2020 13:26
-
-
Save yutakahashi114/6ef11108ebefe5fd3d732f1b14d4d7a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
u.Version = 9999 | |
affected, err = engine. | |
Where("id = ?", id). | |
Update(&u) | |
if err != nil { | |
log.Println(err) | |
return | |
} | |
if affected == 0 { | |
log.Println("Optimistic Lock") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment