title: What's the difference between "<-chan" and "chan" as a function return type?
body: <p>Golang newbie here. </p>
  
  <p>Is there a functional difference between</p>
  
  <pre><code>func randomNumberGenerator() &lt;-chan int {
  </code></pre>
  
  <p>and </p>
  
  <pre><code>func randomNumberGenerator() chan int {
  </code></pre>
  
  <p>I've tried using both and they seem to work fine for me.</p>
  
  <p>I've seen the former used by Rob Pike (one of Go creators) in his Go Concurrency Patterns talk at Google IO 2012. I've also seen it used in Go's official website. Why add 2 extra characters ("&lt;-") when you can omit it? I've tried looking for the difference on the web, but couldn't find it.</p>