func ctxErr() (errc <-chan error, notifyErrOnce func(context.Context)) {
	errch := make(chan error, 1)
	errc = errch
	var once sync.Once
	notifyErrOnce = func(ctx context.Context) {
		once.Do(func() {
			errch <- internal.NewContextError(ctx)
		})
	}
	return
}
ctxErr returns a read-only error channel for receiving a context error and a function for notifying the errc once.
package async
import (
	"context"
	"errors"
	"fmt"
	"sync"
	"github.com/rdleal/go-async/async/internal"
)
type err string
func (e err) Error() string {
	return fmt.Sprintf("[async] %s", string(e))
}
const ErrDependencyGraph = err("invalid dependency graph")
const ErrInvalidFunc = err("invalid function value")
const ErrPanicked = err("panicked")
func IsContextError(err error) bool {
	var ctxErr *internal.ContextError
	return errors.As(err, &ctxErr)
}