title: Golang producer channels as parameter or as return value
body: <p>As far as I know there are two ways of handling producer channels within functions: (1) as parameter or (2) as return value. While for (1) the function is the owner of the channel, the owner in (2) is unknown (for the function.</p>
  
  <p>What is more idiomatic, <code>producer1</code> or <code>producer2</code>? Did I oversee a disadvantage? Are there any specific use scenarios?</p>
  
  <p>Here are the implementation of (1) and (2):</p>
  
  <pre><code>func producer1(numbers []int) &lt;-chan int {
      out := make(chan int)
      go func() {
          defer close(out)
          for _, n := range numbers {
              out &lt;- n
          }
      }()
      return out
  }
  
  func producer2(numbers []int, out &lt;-chan int) {
      go func() {
          defer close(out)
          for _, n := range numbers {
              out &lt;- n
          }
      }()
  }
  </code></pre>