mirror of https://github.com/docker/docs.git
Merge pull request #4395 from creack/remove_goroutine_leak_test
Make the chan for utils.Go buffered in order to avoid goroutine leak
This commit is contained in:
commit
f83482c918
|
@ -33,7 +33,7 @@ type Fataler interface {
|
||||||
// Go is a basic promise implementation: it wraps calls a function in a goroutine,
|
// Go is a basic promise implementation: it wraps calls a function in a goroutine,
|
||||||
// and returns a channel which will later return the function's return value.
|
// and returns a channel which will later return the function's return value.
|
||||||
func Go(f func() error) chan error {
|
func Go(f func() error) chan error {
|
||||||
ch := make(chan error)
|
ch := make(chan error, 1)
|
||||||
go func() {
|
go func() {
|
||||||
ch <- f()
|
ch <- f()
|
||||||
}()
|
}()
|
||||||
|
|
Loading…
Reference in New Issue