diff --git a/waiterr.go b/waiterr.go index 156da4a..0ba8821 100644 --- a/waiterr.go +++ b/waiterr.go @@ -5,7 +5,7 @@ import ( "sync" ) -// WaitErr wraps a sync.WaitGroup with error handling. +// WaitErr wraps a [sync.WaitGroup] with error handling. type WaitErr struct { wg sync.WaitGroup errs []error @@ -17,7 +17,7 @@ type WaitErr struct { } // Go runs f in its own goroutine. When f returns, its error is stored, and returned -// with we.Wait(). +// with [WaitErr.Wait]. func (we *WaitErr) Go(f func() error) { we.initErrChOnce.Do(func() { we.errCh = make(chan error, 1) @@ -90,7 +90,7 @@ func (we *WaitErr) Wait() error { } // Unwrap returns all non-nil errors returned by our functions. -// If we.errs is empty, or all errors are nil, just return nil. +// If no errors were returned, or all errors are nil, it returns nil. func (we *WaitErr) Unwrap() []error { errs := make([]error, 0, len(we.errs)) for _, e := range we.errs {