Created
January 19, 2020 13:13
-
-
Save yutakahashi114/a87ab3c2cc44bf6b36968e339f16e070 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
func delete(engine *xorm.Engine) { | |
u := user{} | |
affected, err := engine. | |
Where("id = ?", id). | |
Delete(&u) | |
if err != nil { | |
log.Println(err) | |
return | |
} | |
if affected == 0 { | |
log.Println("Not Found") | |
return | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment