From c8a1d4735a19eee9c724ec4f4154e0f4828ddfb7 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 | 8 ++++---- pperr_test.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pperr.go b/pperr.go index 21ba22f..4a5a7db 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 } 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()