11 lines
132 B
Go
11 lines
132 B
Go
package iterx
|
|
|
|
func ChanToSlice[V any](c chan V) []V {
|
|
ret := []V{}
|
|
for v := range c {
|
|
ret = append(ret, v)
|
|
}
|
|
|
|
return ret
|
|
}
|
|
|