Skip to content

Instantly share code, notes, and snippets.

@yutakahashi114
Created January 19, 2020 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yutakahashi114/3555bf6d9a0acb967c680060f803b278 to your computer and use it in GitHub Desktop.
Save yutakahashi114/3555bf6d9a0acb967c680060f803b278 to your computer and use it in GitHub Desktop.
affected, err = engine.
Unscoped().
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