AlgoMaster Logo

Channel Directions

Medium Priority20 min readUpdated June 6, 2026

A channel value in Go can be tagged with a direction. The type chan<- T says "you can only send into this channel" and <-chan T says "you can only receive from it". Plain chan T lets you do both. Direction-restricted types are a compile-time tool that lets a function signature spell out exactly what it intends to do with the channel, and the compiler enforces it.

Premium Content

Subscribe to unlock full access to this content and more premium articles.