What are channel direction types (send-only and receive-only), and why are they useful in function signatures?

Last updated 20 June 2026

  • chan<- T is send-only and <-chan T is receive-only (the arrow shows data flowing into or out of the channel).

  • In function signatures they document whether a function produces or consumes. The compiler also rejects misuse, such as sending on or closing a receive-only channel.

  • A bidirectional chan T converts implicitly to either directional type when passed, but not the reverse.

  • https://naesna.es/posts/go-channel-directions/
  • https://dev.to/leapcell/golang-channel-deep-dive-from-zero-to-hero-4com
  • https://medium.com/@AlexanderObregon/channel-direction-types-in-go-6467de14ca88
All Golang interview questions