title: Are channels passed by reference implicitly
body: <p>The go tour has this example for channels: <a href="https://tour.golang.org/concurrency/2" rel="noreferrer">https://tour.golang.org/concurrency/2</a></p>
  
  <pre><code>package main
  
  import "fmt"
  
  func sum(a []int, c chan int) {
      sum := 0
      for _, v := range a {
          sum += v
      }
      c &lt;- sum // send sum to c
  }
  
  func main() {
      a := []int{7, 2, 8, -9, 4, 0}
  
      c := make(chan int)
      go sum(a[:len(a)/2], c)
      go sum(a[len(a)/2:], c)
      x, y := &lt;-c, &lt;-c // receive from c
  
      fmt.Println(x, y, x+y)
  }
  </code></pre>
  
  <p>The channel c is modified in the sum function and the changes persist after the function has terminated. Obviously c was passed by reference but no pointer to c was created. Are channels implicitly passed by reference in go ?</p>