for example:
type name struct {
name string
age int
}
func main() {
c := make(chan name)
c <- name{"sfsaf", 1}
a, b := <- c
close(c)
}
The result:
fatal error: all goroutines are asleep - deadlock!
I want to pass values through channel. What should I do?