title: Go channel : the function of one extra line
body: <p>I am learning Concurrency Pattern in Go, not sure about what is the purpose for Point A ?</p>
  
  <p>Code is taken from: <a href="https://talks.golang.org/2012/concurrency.slide#30" rel="nofollow">https://talks.golang.org/2012/concurrency.slide#30</a></p>
  
  <p>Can anyone explain to me ? Thanks</p>
  
  <pre><code>type Message struct {
      str  string
      wait chan bool
  }
  
  func main() {
      c := fanIn(boring("Joe"), boring("Ann"))
      for i := 0; i &lt; 5; i++ {
          msg1 := &lt;-c
          fmt.Println(msg1.str)
          msg2 := &lt;-c
          fmt.Println(msg2.str)
          msg1.wait &lt;- true
          msg2.wait &lt;- true
      }
      fmt.Println("You're both boring; I'm leaving.")
  }
  
  func fanIn(input1, input2 &lt;-chan Message) &lt;-chan Message {
      c := make(chan Message)
      go func() {
          for {
              c &lt;- &lt;-input1
          }
      }()
      go func() {
          for {
              c &lt;- &lt;-input2
          }
      }()
      return c
  }
  
  func boring(msg string) &lt;-chan Message { 
      waitForIt := make(chan bool)
      c := make(chan Message)
      go func() { // We launch the goroutine from inside the function.
          for i := 0; ; i++ {
              c &lt;- Message{fmt.Sprintf("%s %d", msg, i), waitForIt}
              time.Sleep(time.Duration(rand.Intn(2e3)) * time.Millisecond)
              &lt;-waitForIt                          // &lt;-----------------Point A
          }
      }()
      return c // Return the channel to the caller.
  }
  </code></pre>