NewErrorCollector creates a new error collector If failFast is true, the collector will stop at the first error
(failFast bool)
| 209 | // NewErrorCollector creates a new error collector |
| 210 | // If failFast is true, the collector will stop at the first error |
| 211 | func NewErrorCollector(failFast bool) *ErrorCollector { |
| 212 | if errorAggregationLog.Enabled() { |
| 213 | errorAggregationLog.Printf("Creating error collector: fail_fast=%v", failFast) |
| 214 | } |
| 215 | return &ErrorCollector{ |
| 216 | errors: make([]error, 0), |
| 217 | failFast: failFast, |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | // Add adds an error to the collector |
| 222 | // If failFast is enabled, returns the error immediately |