From: qydysky Date: Tue, 19 Nov 2024 17:54:03 +0000 (+0800) Subject: 1 X-Git-Tag: v0.28.20241119180138 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=bb51206bab3d3d8d8b5b863b6670355b4c4d3b11;p=part%2F.git 1 --- 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() } }