From d3a6ee1e55a53ee54b91ffb6c53ba674768cf9de Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Fri, 28 Feb 2014 16:35:43 -0800 Subject: [PATCH] Make the chan for utils.Go buffered in order to avoid goroutine leak Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes (github: creack) --- utils/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/utils.go b/utils/utils.go index f24e17c38e..7fa046c48b 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -33,7 +33,7 @@ type Fataler interface { // 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. func Go(f func() error) chan error { - ch := make(chan error) + ch := make(chan error, 1) go func() { ch <- f() }()