Browse Source

Make the chan for utils.Go buffered in order to avoid goroutine leak

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Guillaume J. Charmes 11 years ago
parent
commit
d3a6ee1e55
1 changed files with 1 additions and 1 deletions
  1. 1 1
      utils/utils.go

+ 1 - 1
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()
 	}()