Skip to content

Instantly share code, notes, and snippets.

@jordanorelli
Created July 13, 2012 21:36
Show Gist options
  • Save jordanorelli/3107670 to your computer and use it in GitHub Desktop.
Save jordanorelli/3107670 to your computer and use it in GitHub Desktop.
why does this not time out?
package main
import (
"net/http"
"time"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
time.Sleep(10 * time.Second)
w.Write([]byte("hey"))
})
server := http.Server{
Addr: ":8000",
WriteTimeout: 3 * time.Second,
}
server.ListenAndServe()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment