gods/iterx/misc.go
2023-08-27 15:41:30 +03:00

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
}