Created
April 19, 2018 18:15
-
-
Save campoy/7e7bb4713abeb7d1e48c67831937fff9 to your computer and use it in GitHub Desktop.
Don't use panics as exceptions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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