-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
by shawn.hek:
i just write a simple program as follow: import ( "http" "fmt" ) var counter int; func handler(w http.ResponseWriter, r *http.Request) { counter++ fmt.Printf("%d\n", counter) } func main() { http.HandleFunc("/", handler) http.ListenAndServe(":12345", nil) } but the console output confused me--every time i open the url in the browser, it outputs twice like 0 1 // 1st 2 3 // 2nd and so on