Created
December 15, 2016 18:16
-
-
Save jordanorelli/3093f66cc9fca11254be12d9cade3d99 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 ( | |
"time" | |
"net/http" | |
) | |
func panicLater() { | |
time.Sleep(time.Second) | |
panic("we dead now") | |
} | |
func handler(w http.ResponseWriter, r *http.Request) { | |
go panicLater() | |
w.Write([]byte("hi")) | |
} | |
func main() { | |
http.ListenAndServe(":9000", http.HandlerFunc(handler)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment