Skip to content

Instantly share code, notes, and snippets.

@yutakahashi114
Created January 19, 2020 13:22
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/cf8e493cfdaca60e408c2e23af3773e2 to your computer and use it in GitHub Desktop.
Save yutakahashi114/cf8e493cfdaca60e408c2e23af3773e2 to your computer and use it in GitHub Desktop.
var friendID uint64
has, err = engine.
Table("friends").
Where("user_id = ?", id).
Where("deleted_at IS NULL").
Desc("created_at").
Cols("friend_id").
Get(&friendID)
if err != nil {
log.Println(err)
return
}
if !has {
log.Println("Not Found")
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment