Skip to content

Instantly share code, notes, and snippets.

@beomkm
Last active June 27, 2018 08:35
Show Gist options
  • Save beomkm/44c04df67b069cc51ad49ba3fe0df2c3 to your computer and use it in GitHub Desktop.
Save beomkm/44c04df67b069cc51ad49ba3fe0df2c3 to your computer and use it in GitHub Desktop.
(In function)
defer func() {
log.Fatal("defer1")
if r := recover(); r != nil {
log.Fatal("ERROR")
}
}
rows, err := db.Query(sql)
if err != nil {
log.Fatal("panic1")
panic("234")
}
defer rows.Close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment