Created
July 13, 2012 21:36
-
-
Save jordanorelli/3107670 to your computer and use it in GitHub Desktop.
why does this not time out?
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 ( | |
"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