future.go 131 B

1234567891011
  1. package future
  2. import ()
  3. func Go(f func() error) chan error {
  4. ch := make(chan error)
  5. go func() {
  6. ch <- f()
  7. }()
  8. return ch
  9. }