-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: concurrent apply / status checks -> LVMCluster
- Loading branch information
1 parent
fe456ff
commit 4aca845
Showing
6 changed files
with
117 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package internal | ||
|
||
import ( | ||
"strings" | ||
) | ||
|
||
// NewMultiErrorWithNewLineSeparator creates a MultiError that uses "\n" as separator for each error. | ||
func NewMultiErrorWithNewLineSeparator(errs []error) error { | ||
return &MultiError{Errors: errs, Separator: "\n"} | ||
} | ||
|
||
// MultiError is an error that aggregates multiple errors together and uses | ||
// a separator to aggregate them when called with Error. | ||
type MultiError struct { | ||
Errors []error | ||
Separator string | ||
} | ||
|
||
func (m *MultiError) Error() string { | ||
errs := make([]string, len(m.Errors)) | ||
for i, err := range m.Errors { | ||
errs[i] = err.Error() | ||
} | ||
return strings.Join(errs, m.Separator) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters