Change writeFixedFile to replace the right line-range.
The function assumed, previously, that issue.Line always equals issue.LineRange.From. But this needn't be true, and the code needn't assume it. Now we actually replace the specified line-range.
This commit is contained in:
parent
45f1e48f3d
commit
06d26d5c12
@ -218,7 +218,7 @@ func (f Fixer) writeFixedFile(origFileLines [][]byte, issues []result.Issue, tmp
|
||||
}
|
||||
|
||||
origFileLineNumber := i + 1
|
||||
if nextIssue == nil || origFileLineNumber != nextIssue.Line() {
|
||||
if nextIssue == nil || origFileLineNumber != nextIssue.GetLineRange().From {
|
||||
outLine = string(origFileLines[i])
|
||||
} else {
|
||||
nextIssueIndex++
|
||||
|
Loading…
x
Reference in New Issue
Block a user