From e4a5958fc8d9e131ab083215a51a1b60acf91410 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sun, 18 Jul 2021 22:15:35 +0900 Subject: Detect multiple semantic errors in a single parse --- error/error.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'error/error.go') diff --git a/error/error.go b/error/error.go index 1e5df7a..f953e3b 100644 --- a/error/error.go +++ b/error/error.go @@ -25,6 +25,7 @@ func (e SpecErrors) Error() string { type SpecError struct { Cause error + Detail string FilePath string SourceName string Row int @@ -39,6 +40,9 @@ func (e *SpecError) Error() string { fmt.Fprintf(&b, "%v: ", e.Row) } fmt.Fprintf(&b, "error: %v", e.Cause) + if e.Detail != "" { + fmt.Fprintf(&b, ": %v", e.Detail) + } line := readLine(e.FilePath, e.Row) if line != "" { -- cgit v1.2.3