From 2e0cffc0449210c5a580db8256075b80bfabeade Mon Sep 17 00:00:00 2001 From: PacoDw <__pm@outlook.com> Date: Wed, 23 Oct 2019 14:16:23 -0500 Subject: [PATCH] feat: added handler to convert an error slice to string slice --- caste.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/caste.go b/caste.go index a4859fb..8b3fdae 100644 --- a/caste.go +++ b/caste.go @@ -1131,6 +1131,11 @@ func ToStringSliceE(i interface{}) ([]string, error) { return v, nil case string: return strings.Fields(v), nil + case []error: + for _, err := range i.([]error) { + a = append(a, err.Error()) + } + return a, nil case interface{}: str, err := ToStringE(v) if err != nil {