File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ type Chain []*Link
3232// Error returns the formatted error string
3333func (c Chain ) Error () string {
3434 lines := make ([]string , 0 , len (c ))
35- // source=<source> <prefix>: <error> tag=value tag2=value2 types=type1,type2
35+ //source=<source> <prefix>: <error> tag=value tag2=value2 types=type1,type2
3636 for i := len (c ) - 1 ; i >= 0 ; i -- {
3737 line := c [i ].formatError ()
3838 lines = append (lines , line )
@@ -65,10 +65,15 @@ func (l *Link) formatError() string {
6565 line := fmt .Sprintf ("source=%s " , l .Source )
6666
6767 if l .Prefix != "" {
68- line += l .Prefix + ": "
68+ line += l .Prefix
6969 }
7070
71- line += l .Err .Error ()
71+ if _ , ok := l .Err .(Chain ); ! ok {
72+ if l .Prefix != "" {
73+ line += ": "
74+ }
75+ line += l .Err .Error ()
76+ }
7277
7378 for _ , tag := range l .Tags {
7479 line += fmt .Sprintf (" %s=%v" , tag .Key , tag .Value )
You can’t perform that action at this time.
0 commit comments