5 ms·
Did you not understand the func merge[T](cs ...<-chan T) <-chan T reference? The author doesn't want to send something random, they want to send things of a
by mikelward 11y ago
Did you not understand the
func merge[T](cs ...<-chan T) <-chan T
reference?
The author doesn't want to send something random, they want to send things of a single type, where the type is defined at compile time, without re-writing functions like 'merge'.
- elcct 11y agoI think I was not clear - I mean essentially what you replied. I think this is still a try to apply mindset of one thing to another. You can't do generics in Go (well, you can use template system if you really want), so why would you try to solve the problems with generics in mind? It is like you were really upset that getting family in an industrial truck to Disneyland is not comfortable. If you have a problem that requires generics, use something else than Go.