From c639ceaf803095a80ffceb91ac0c0cc51e67a0f0 Mon Sep 17 00:00:00 2001 From: kazukousen Date: Tue, 9 Jan 2024 16:03:13 +0900 Subject: [PATCH] Fix function name --- pperr.go | 10 +++++----- pperr_test.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pperr.go b/pperr.go index 21ba22f..c47e6f8 100644 --- a/pperr.go +++ b/pperr.go @@ -34,16 +34,16 @@ func Fprint(w io.Writer, err error) { } func FprintFunc(w io.Writer, err error, puts Printer) { - for _, e := range extractErrorSet(err, nil) { + for _, e := range extractErrorSets(err, nil) { puts(w, e.Error, e.Frames, e.Parent) } } -func ExtractErrorSet(err error) []ErrorSet { - return extractErrorSet(err, nil) +func ExtractErrorSets(err error) ErrorSets { + return extractErrorSets(err, nil) } -func extractErrorSet(err error, parent Frames) []ErrorSet { +func extractErrorSets(err error, parent Frames) []ErrorSet { if err == nil { return nil } @@ -70,7 +70,7 @@ func extractErrorSet(err error, parent Frames) []ErrorSet { causeParent = parent } - if es := extractErrorSet(withCause.Unwrap(), causeParent); es != nil { + if es := extractErrorSets(withCause.Unwrap(), causeParent); es != nil { errs = es } } diff --git a/pperr_test.go b/pperr_test.go index 76f6a31..c100ed5 100644 --- a/pperr_test.go +++ b/pperr_test.go @@ -42,13 +42,13 @@ func f3(native bool) error { } } -func TestExtractErrorSet(t *testing.T) { +func TestExtractErrorSets(t *testing.T) { assert := assert.New(t) err := f1(true) var buf strings.Builder - for _, e := range pperr.ExtractErrorSet(err) { + for _, e := range pperr.ExtractErrorSets(err) { pperr.DefaultPrinter(&buf, e.Error, e.Frames, e.Parent) } actual := buf.String()