title: Wait for a buffered channel to be full
body: <p>I must have missed something because I haven't found the answer online for this pretty basic problem. I am using a buffered channel capable of holding three <code>int</code> values. </p>
  
  <p>I am then using three goroutines to fill it up and I want to do an operation once the buffered channel is full.</p>
  
  <p>Here is a snippet explaining the problem:</p>
  
  <pre><code>func main() {
      // Initialization of the slice a and 0 &lt; n &lt; len(a) - 1.
      difs := make(chan int, 3)
      go routine(a[:n], difs)
      go routine(a[n + 1:], difs)
      go routine(a[n - 1:n + 1], difs)
  
      fmt.Println(&lt;-difs) // Display the first result returned by one of the routine.
  }
  
  func routine(a []int, out chan&lt;- int) {
      // Long computation.
      out &lt;- result
  }
  </code></pre>
  
  <p>I would like to update my code so that <code>fmt.Println(&lt;-difs)</code> displays an array of <code>int</code> when all the values have been computed. I could use three times <code>&lt;-difs</code> but I wonder if Go offers something cleaner to do that.</p>