Original post

I would like to start a discussion about channel type safety.

At the moment, you can do this.
This code compiles.

func main()  {
	ch := make(chan bool)
	someFunc(ch)
	close(ch)
}

func someFunc(ch chan bool)  {
	close(ch)
}

Ideally, i would be able to describe what someFunc can actually do to my channel.
chan<- bool and <-chan bool are good, but i think we need more.

This could be done in a specific way for channels or adding a more general behavior description.
Something like Rust’s mut comes to mind.