Skip to content

Commit

Permalink
Support fixing multiple empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
bombsimon committed Oct 3, 2023
1 parent fad6186 commit e88f182
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/golinters/whitespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ func NewWhitespace(settings *config.WhitespaceSettings) *goanalysis.Linter {
switch issue.MessageType {

Check failure on line 49 in pkg/golinters/whitespace.go

View workflow job for this annotation

GitHub Actions / golangci-lint

issue.MessageType undefined (type whitespace.Message has no field or method MessageType)
case whitespace.MessageTypeRemove:

Check failure on line 50 in pkg/golinters/whitespace.go

View workflow job for this annotation

GitHub Actions / golangci-lint

undefined: whitespace.MessageTypeRemove
report.LineRange = &result.Range{
From: issue.LineNumber,
To: issue.LineNumber,
From: issue.LineNumbers[0],

Check failure on line 52 in pkg/golinters/whitespace.go

View workflow job for this annotation

GitHub Actions / golangci-lint

issue.LineNumbers undefined (type whitespace.Message has no field or method LineNumbers)
To: issue.LineNumbers[len(issue.LineNumbers)-1],

Check failure on line 53 in pkg/golinters/whitespace.go

View workflow job for this annotation

GitHub Actions / golangci-lint

issue.LineNumbers undefined (type whitespace.Message has no field or method LineNumbers)
}

report.Replacement = &result.Replacement{
Expand Down
1 change: 0 additions & 1 deletion test/testdata/fix/out/whitespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func oneLeadingNewlineWithCommentFunc() {
}

func twoLeadingNewlines() {

fmt.Println("Hello world")
}

Expand Down

0 comments on commit e88f182

Please sign in to comment.