Lesson 14 of 60
GoChannels: Communication Between Goroutines
20 minutes
Course progress23%
Channels
This lesson explains the main concept clearly with beginner-friendly examples and background so you can learn why the code works.
Channels are typed conduits that allow goroutines to communicate safely.
ch := make(chan int) // unbuffered channel
go { ch <- }()
val := <-ch
fmt.Println(val)