Skip to content

Instantly share code, notes, and snippets.

@campoy
Created April 19, 2018 18: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 campoy/7e7bb4713abeb7d1e48c67831937fff9 to your computer and use it in GitHub Desktop.
Save campoy/7e7bb4713abeb7d1e48c67831937fff9 to your computer and use it in GitHub Desktop.
Don't use panics as exceptions.
package main
import (
"log"
"net/http"
)
func main() {
http.HandleFunc("/", handler)
log.Fatal(http.ListenAndServe(":8080", nil))
}
func handler(w http.ResponseWriter, r *http.Request) {
go panic("boo!")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment