We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents facb4e6 + 904b2a1 commit 5ded3fbCopy full SHA for 5ded3fb
pkg/nlreturn/nlreturn.go
@@ -1,6 +1,7 @@
1
package nlreturn
2
3
import (
4
+ "fmt"
5
"go/ast"
6
"go/token"
7
@@ -49,7 +50,21 @@ func inspectBlock(pass *analysis.Pass, block []ast.Stmt) {
49
50
}
51
52
if line(pass, stmt.Pos())-line(pass, block[i-1].End()) <= 1 {
- pass.Reportf(stmt.Pos(), "%s with no blank line before", name(stmt))
53
+ pass.Report(analysis.Diagnostic{
54
+ Pos: stmt.Pos(),
55
+ Message: fmt.Sprintf("%s with no blank line before", name(stmt)),
56
+ SuggestedFixes: []analysis.SuggestedFix{
57
+ {
58
+ TextEdits: []analysis.TextEdit{
59
60
61
+ NewText: []byte("\n"),
62
+ End: stmt.Pos(),
63
+ },
64
65
66
67
+ })
68
69
70
0 commit comments