From 3a363e8c46039fa0cbbb72b169f72efa32392d6c Mon Sep 17 00:00:00 2001 From: Jonas Lundberg Date: Mon, 17 Jun 2024 21:58:28 +0200 Subject: [PATCH] Redeclared section line was one off Test plan: * Have two section headings, verify error message of the first redeclaration is not off by one anymore. --- internal/pkg/parse/capture.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/pkg/parse/capture.go b/internal/pkg/parse/capture.go index 184309b..7fcf2f2 100644 --- a/internal/pkg/parse/capture.go +++ b/internal/pkg/parse/capture.go @@ -42,7 +42,7 @@ func (s *sectionedTemplate) checkValidHeadings(capturedSections []capturedSectio } for _, headingSourceLineIndex := range headingSourceLineIndexes[1:] { - s.setFatalMessage(fmt.Sprintf("Section %s on line %d redeclared", heading, headingSourceLineIndexes[0]), headingSourceLineIndex) + s.setFatalMessage(fmt.Sprintf("Section %s on line %d redeclared", heading, headingSourceLineIndexes[0]+1), headingSourceLineIndex) } } }