• Send only: chan<- int
  • Receive only: <-chan int
  • Violation will compile error
  • Only channel used to send msg need to be closed, so to close a receive only channel will compile error
  • A channel can be passed as an unidirectional channel. So that can be foced to use it correctly in function.
  • Can convert a bidirectional channel to unidirectional, but not vice versa


Tags:

Updated: