Skip to content

Commit

Permalink
Redeclared section line was one off
Browse files Browse the repository at this point in the history
Test plan:
* Have two section headings,
  verify error message of the
  first redeclaration is not
  off by one anymore.
  • Loading branch information
jonaslu committed Jun 17, 2024
1 parent 14b28eb commit 3a363e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/pkg/parse/capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit 3a363e8

Please sign in to comment.