From aa6fa14f1e1f53a7150df6658b71bede59e0da9d Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Tue, 17 Oct 2023 16:51:50 +0200 Subject: [PATCH] feat!: remove util.MultiErr --- CHANGELOG.md | 2 ++ util/util.go | 18 ------------------ 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79ff0f4b8..150d73d10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/util/util.go b/util/util.go index 74cf1aaff..7a96ae393 100644 --- a/util/util.go +++ b/util/util.go @@ -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!"]