Skip to content

Commit

Permalink
Merge pull request #7 from getoutreach/is_resolved
Browse files Browse the repository at this point in the history
feat: is_resolved
  • Loading branch information
pavelsmejkal authored Jun 27, 2024
2 parents 1cab234 + 138d514 commit 6f77195
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions plumber.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,15 @@ func (rr *ResolutionR[T]) ResolveAdapter(v T, runnable RunnerCloser) {
func (rr *ResolutionR[T]) Require(deps ...Dependency) *Future[T] {
return rr.resolution.Require(deps...)
}

// Resolved checks given dependencies and checks whether they are resolved or not.
// Multi error is returned.
func Resolved(deps ...interface{ Error() error }) error {
var errs []error
for _, d := range deps {
if err := d.Error(); err != nil {
errs = append(errs, err)
}
}
return errors.Join(errs...)
}

0 comments on commit 6f77195

Please sign in to comment.