github.com/vieux/docker@v0.6.3-0.20161004191708-e097c2a938c7/pkg/promise/promise.go (about) 1 package promise 2 3 // Go is a basic promise implementation: it wraps calls a function in a goroutine, 4 // and returns a channel which will later return the function's return value. 5 func Go(f func() error) chan error { 6 ch := make(chan error, 1) 7 go func() { 8 ch <- f() 9 }() 10 return ch 11 }