title: Passing value to channel is blocking the thread for some reason
body: <p>I'm using a channel to pass messages from an HTTP handler:</p>
  
  <pre><code>package server
  
  import (
      "bytes"
      "errors"
      "io/ioutil"
      "log"
      "net/http"
  )
  
  type Server struct {}
  
  func (s Server) Listen() chan interface{} {
      ch := make(chan interface{})
      http.HandleFunc("/", handle(ch))
      go http.ListenAndServe(":8080", nil)
      return ch
  }
  
  func handle(ch chan interface{}) func(http.ResponseWriter, *http.Request) {
      return func(w http.ResponseWriter, r *http.Request) {
          w.Header().Set("Content-Type", "application/json")
          b, err := ioutil.ReadAll(r.Body)
          defer r.Body.Close()
          if err != nil {
              ch &lt;- errors.New(string(500))
              return
          }
          w.Write([]byte("Hello World"))
          log.Print("about to pass to handler channel")
          ch &lt;- bytes.NewBuffer(b)
          log.Print("passed to handler channel")
      }
  } 
  </code></pre>
  
  <p>When I make a request to the server running on port 8080, the thread blocks on this line:</p>
  
  <pre><code>ch &lt;- bytes.NewBuffer(b)
  </code></pre>
  
  <p>Why is this happening? If you notice, I'm running the listener in a goroutine. I also figured that HTTP handles happen in a separate thread. If I delete the above line, the thread becomes unblocked and the program works as expected. What am I doing wrong?</p>
  
  <p>To clarify, I want to be able to pass the body of a POST request to a channel. Help.</p>
  
  <p><strong>UPDATE:</strong>
  I'm reading from the channel on the main thread:</p>
  
  <pre><code>listenerChan := n.Listen()
  go SendRequest("POST", "http://localhost:8080", []byte("hello"))
  for listenedMsg := range listenerChan {
      log.Print("listened message&gt;&gt;&gt;&gt; ", listenedMsg)
  }
  </code></pre>
  
  <p>But the thread still blocks on the same line. For clarification, there is nothing wrong with how im sending the request. If I remove the channel send line above, the thread doesnt block.</p>