From 85b5d3ef36c9b12923404caf1c57497aa84cd50d Mon Sep 17 00:00:00 2001 From: i582 Date: Sat, 31 Jul 2021 19:45:26 +0300 Subject: [PATCH] cmd: added file path output before errors --- cmd/php-parser/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index e64a883..db931ff 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -168,10 +168,12 @@ func printerWorker(r <-chan result) { _, _ = io.WriteString(os.Stderr, "==> ["+strconv.Itoa(counter)+"] "+res.path+"\n") } - if *printErrors { + if *printErrors && len(res.errors) > 0 { + _, _ = io.WriteString(os.Stderr, "==> ["+strconv.Itoa(counter)+"] "+res.path+"\n") for _, e := range res.errors { _, _ = io.WriteString(os.Stderr, "==> "+e.String()+"\n") } + _, _ = io.WriteString(os.Stderr, "\n") } if *printBack {