lo
lo copied to clipboard
Why Async doesn't close a chan?
// Async executes a function in a goroutine and returns the result in a channel.
func Async[A any](f func() A) <-chan A {
ch := make(chan A, 1)
go func() {
ch <- f()
}()
return ch
}
Why Async doesn't close the chan?