// Wrap takes a function which returns an error and executes
// it inside a goroutine.  This goroutine captures any (non-nil)
// error from the execution and returns it on the ErrChan.
Wrap takes a function which returns an error and executes
it inside a goroutine.  This goroutine captures any (non-nil)
error from the execution and returns it on the ErrChan.
// Wrap takes a function which returns an error and executes // it inside a goroutine . This goroutine captures any ( non - nil ) // error from the execution and returns it on the ErrChan .
func (e *ErrChan) Wrap(f func() error) {
	go func() {
		if err := f(); err != nil {
			if !e.closed {
				e.c <- err
			}
		}
	}()
}
func ( e * ErrChan ) Wrap ( f func ( ) error ) { go func ( ) { if err := f ( ) ; err != nil { if ! e . closed { e . c <- err } } } ( ) }
Wrap takes a function which returns an error and executes
it inside a goroutine.
Wrap takes a function which returns an error and executes it inside a goroutine .