From bb51206bab3d3d8d8b5b863b6670355b4c4d3b11 Mon Sep 17 00:00:00 2001 From: qydysky Date: Wed, 20 Nov 2024 01:54:03 +0800 Subject: [PATCH] 1 --- errors/errors.go | 6 +++--- errors/errors_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/errors/errors.go b/errors/errors.go index 1a41de6..550f771 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -124,13 +124,13 @@ var ( } } ErrInLineFunc = func(e error) string { - return "> " + e.Error() + return "> " + e.Error() + " " } ErrActionInLineFunc = func(e error) string { if err, ok := e.(Error); ok { - return "> " + err.action + ":" + e.Error() + return "> " + err.action + ":" + e.Error() + " " } else { - return "> " + e.Error() + return "> " + e.Error() + " " } } ) diff --git a/errors/errors_test.go b/errors/errors_test.go index c7c2325..14882ea 100644 --- a/errors/errors_test.go +++ b/errors/errors_test.go @@ -45,7 +45,7 @@ func Test2(t *testing.T) { if ErrorFormat(e, ErrSimplifyFunc) != "a0\na1\n" { t.FailNow() } - if ErrorFormat(e, ErrInLineFunc) != " > a0 > a1" { + if ErrorFormat(e, ErrInLineFunc) != "> a0 > a1 " { t.FailNow() } } @@ -59,7 +59,7 @@ func Test1(t *testing.T) { if ErrorFormat(e, ErrSimplifyFunc) != "EOF\nEOF\nio: read/write on closed pipe\n" { t.FailNow() } - if ErrorFormat(e, ErrInLineFunc) != " > EOF > EOF > io: read/write on closed pipe" { + if ErrorFormat(e, ErrInLineFunc) != "> EOF > EOF > io: read/write on closed pipe " { t.FailNow() } } -- 2.39.2