title: Goroutine does not run
body: <p>I'm trying to use a goroutine to write item to database. The goroutine however doesn't seem to do anything for some reason.</p>
  
  <p>I've got following functions:</p>
  
  <pre><code>func addEvent(w http.ResponseWriter, r *http.Request) {
      body, err := ioutil.ReadAll(r.Body)
      fmt.Println(string(body[:]))
  
      if err != nil {
          panic(err)
      }
  
      eventCh := make(chan []byte)
      eventCh &lt;- body
      go models.WriteEventToDb(eventCh)
  
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>func WriteEventToDb(eventCh chan []byte) {
      fmt.Println("event")
      event := &lt;-eventCh
      newEvent := createNewEvent(event)
      err := db.Insert(&amp;newEvent)
  
      if err != nil {
          panic(err)
      }
  
  }
  </code></pre>
  
  <p>Any idea why WriteEventToDb does not run?</p>