Skip to content

Instantly share code, notes, and snippets.

@campoy
Created Apr 19, 2018
Embed
What would you like to do?
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