multierror and multilogger cleaned up.
This commit is contained in:
@@ -25,7 +25,7 @@ Example:
|
||||
}
|
||||
|
||||
if errs != nil && len(errs) != 0 {
|
||||
// err now contains multiple errors presented as a single error.
|
||||
// err now contains multiple errors presented as a single error interface.
|
||||
err = multierr.NewErrors(errs...)
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,12 @@ MultiError also has a shorthand, making the above much less verbose:
|
||||
}
|
||||
}()
|
||||
}
|
||||
// multierror now contains any/all errors above.
|
||||
|
||||
// multierror now contains any/all errors above. If calling in a function, you'll probably want to do:
|
||||
// if !multierror.IsEmpty() {
|
||||
// err = multierror
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
In the above, the multierror assignment can still be used as an error.
|
||||
|
||||
Reference in New Issue
Block a user