]> 127.0.0.1 Git - part/.git/commitdiff
1 v0.28.20241119180138 v0.28.20241212152049
authorqydysky <qydysky@foxmail.com>
Tue, 19 Nov 2024 17:54:03 +0000 (01:54 +0800)
committerqydysky <qydysky@foxmail.com>
Tue, 19 Nov 2024 17:54:03 +0000 (01:54 +0800)
errors/errors.go
errors/errors_test.go

index 1a41de6f9e29035f3af2943bd2a2f8b614e9bf7f..550f7718432d0bac013ecbb00cbe52a124a007ca 100644 (file)
@@ -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() + " "
                }
        }
 )
index c7c2325d5d70d199003bbae2dc26af71b0f26eb3..14882ea0083e44e59eb291ff5c58ba4bb6189476 100644 (file)
@@ -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()
        }
 }