title: Why is my webserver in golang not handling concurrent requests?
body: <p>This simple HTTP server contains a call to time.Sleep() that makes
  each request take five seconds. When I try quickly loading multiple
  tabs in a browser, it is obvious that each request
  is queued and handled sequentially. How can I make it handle concurrent requests?</p>
  
  <pre><code>package main
  
  import (
     "fmt"
     "net/http"
     "time"
  )
  
  func serve(w http.ResponseWriter, r *http.Request) {
     fmt.Fprintln(w, "Hello, world.")
     time.Sleep(5 * time.Second)
  }
  
  func main() {
     http.HandleFunc("/", serve)
     http.ListenAndServe(":1234", nil) 
  }
  </code></pre>
  
  <p>Actually, I just found the answer to this after writing the question, and it is very subtle. I am posting it anyway, because I couldn't find the answer on Google. Can you see what I am doing wrong?</p>