Skip to content

Commit

Permalink
feat!: remove util.MultiErr
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Oct 17, 2023
1 parent 8660c62 commit aa6fa14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ The following emojis are used to highlight certain changes:

### Removed

* 🛠 `util.MultiErr` has been removed. Please use Go's native support for wrapping errors, or `errors.Join` instead.

### Fixed

### Security
Expand Down
18 changes: 0 additions & 18 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,6 @@ func GetenvBool(name string) bool {
return v == "true" || v == "t" || v == "1"
}

// MultiErr is a util to return multiple errors
type MultiErr []error

func (m MultiErr) Error() string {
if len(m) == 0 {
return "no errors"
}

s := "Multiple errors: "
for i, e := range m {
if i != 0 {
s += ", "
}
s += e.Error()
}
return s
}

// Partition splits a subject 3 parts: prefix, separator, suffix.
// The first occurrence of the separator will be matched.
// ie. Partition("Ready, steady, go!", ", ") -> ["Ready", ", ", "steady, go!"]
Expand Down

0 comments on commit aa6fa14

Please sign in to comment.