mirror of
https://github.com/containers/podman.git
synced 2025-09-28 01:04:28 +08:00
Initial checkin from CRI-O repo
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
This commit is contained in:
11
vendor/github.com/containers/storage/pkg/promise/promise.go
generated
vendored
Normal file
11
vendor/github.com/containers/storage/pkg/promise/promise.go
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
package promise
|
||||
|
||||
// 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, 1)
|
||||
go func() {
|
||||
ch <- f()
|
||||
}()
|
||||
return ch
|
||||
}
|
Reference in New Issue
Block a user