gods/iterx/misc.go

12 lines
132 B
Go
Raw Normal View History

2023-07-21 20:38:32 +03:00
package iterx
func ChanToSlice[V any](c chan V) []V {
ret := []V{}
for v := range c {
ret = append(ret, v)
}
return ret
}