Skip to content

Instantly share code, notes, and snippets.

@jordanorelli
Created December 15, 2016 18:16
Show Gist options
  • Save jordanorelli/3093f66cc9fca11254be12d9cade3d99 to your computer and use it in GitHub Desktop.
Save jordanorelli/3093f66cc9fca11254be12d9cade3d99 to your computer and use it in GitHub Desktop.
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