diff --git a/taskgroup.go b/taskgroup.go index b159d99..156f129 100644 --- a/taskgroup.go +++ b/taskgroup.go @@ -179,6 +179,8 @@ func adaptErrorFunc(ef any) errorFunc { } // NoError adapts f to a Task that executes f and reports a nil error. +// +// Deprecated: Use [Group.Run] or [taskgroup.Run] instead. func NoError(f func()) Task { return func() error { f(); return nil } } func noError(f func()) Task { return func() error { f(); return nil } } diff --git a/throttle.go b/throttle.go index c4f905b..4548a65 100644 --- a/throttle.go +++ b/throttle.go @@ -54,4 +54,4 @@ func (s StartFunc) Go(task Task) { s(task) } // Run is a legibility shorthand for calling s with a task that runs f and // reports a nil error. -func (s StartFunc) Run(f func()) { s(NoError(f)) } +func (s StartFunc) Run(f func()) { s(noError(f)) }