title: Can't get map of channels to work
body: <p>This might be a rookies mistake. I have a slice with a string value and a map of channels. For each string in the slice, a channel is created and a map entry is created for it, with the string as key.</p>
  
  <p>I watch the channels and pass a value to one of them, which is never found.</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "time"
  )
  
  type TestStruct struct {
      Test string
  }
  
  var channelsMap map[string](chan *TestStruct)
  
  func main() {
      stringsSlice := []string{"value1"}
      channelsMap := make(map[string](chan *TestStruct))
  
      for _, value := range stringsSlice {
          channelsMap[value] = make(chan *TestStruct, 1)
  
          go watchChannel(value)
      }
  
      &lt;-time.After(3 * time.Second)
  
      testStruct := new(TestStruct)
      testStruct.Test = "Hello!"
      channelsMap["value1"] &lt;- testStruct
  
      &lt;-time.After(3 * time.Second)
      fmt.Println("Program ended")
  }
  
  func watchChannel(channelMapKey string) {
      fmt.Println("Watching channel: " + channelMapKey)
  
      for channelValue := range channelsMap[channelMapKey] {
          fmt.Printf("Channel '%s' used. Passed value: '%s'\n", channelMapKey, channelValue.Test)
      }
  
  }
  </code></pre>
  
  <p>Playground link: <a href="https://play.golang.org/p/IbucTqMjdGO" rel="nofollow noreferrer">https://play.golang.org/p/IbucTqMjdGO</a></p>
  
  <p>Output:</p>
  
  <pre><code>Watching channel: value1
  Program ended
  </code></pre>
  
  <p>How do I execute something when the message is fed into the channel?</p>