Skip to content

Commit

Permalink
taskgroup: remove the now-obsolete NoError helper
Browse files Browse the repository at this point in the history
  • Loading branch information
creachadair committed Nov 20, 2024
1 parent 355e2c5 commit 7742ba8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions taskgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ func adaptErrorFunc(ef any) errorFunc {
}
}

// NoError adapts f to a Task that executes f and reports a nil error.
func NoError(f func()) Task { return func() error { f(); return nil } }

// noError adapts f to a Task that executes f and reports a nil error.
func noError(f func()) Task { return func() error { f(); return nil } }

// Limit returns g and a [StartFunc] that starts each task passed to it in g,
Expand Down
2 changes: 1 addition & 1 deletion throttle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)) }

0 comments on commit 7742ba8

Please sign in to comment.