advent-of-code/ranger/channel.go
xuu 50af2114d4
Some checks failed
Go Bump / bump (push) Failing after 6s
Go Test / build (push) Failing after 21s
add ranger
2024-04-05 16:27:02 -06:00

16 lines
153 B
Go

package main
func countChan(n int) <-chan int {
ch := make(chan int)
go func() {
for i := range n {
ch <- i
}
close(ch)
}()
return ch
}