The go tour has this example for channels: https://tour.golang.org/concurrency/2
package main
import \"fmt\"
func sum(a []int, c chan int) {
sum := 0
f
Everything in Go is passed and assigned by value. Certain built-in types, including channel types and map types, behave as opaque pointers to some hidden internal structure. And it is possible to modify that internal structure by operations on the channel or map. They start out as nil
, which is analogous to the nil
pointer.