Convert chan to non chan in golang
Is it possible to let function funcWithNonChanResult have the following interface: func funcWithNonChanResult() int { And if I want it to use function funcWithChanResult with the interface: func funcWithChanResult() chan int { In other words, can I somehow convert chan int to int ? Or I must have chan int result type in all the functions which use funcWithChanResult ? Currently, I tried these methods: result = funcWithChanResult() // cannot use funcWithChanResult() (type chan int) as type int in assignment result <- funcWithChanResult() // invalid operation: result <- funcWithChanResult()