QF1003: emit short range position information
@@ -514,7 +514,8 @@ func CheckIfElseToSwitch(pass *analysis.Pass) (interface{}, error) {
// FIXME this forces the first case to begin in column 0. try to fix the indentation
edits = append(edits, edit.ReplaceWithString(pass.Fset, edit.Range{ifstmt.If, ifstmt.If}, fmt.Sprintf("switch %s {\n", report.Render(pass, x))))
report.Report(pass, ifstmt, fmt.Sprintf("could use tagged switch on %s", report.Render(pass, x)),
- report.Fixes(edit.Fix("Replace with tagged switch", edits...)))
+ report.Fixes(edit.Fix("Replace with tagged switch", edits...)),
+ report.ShortRange())
}
code.PreorderStack(pass, fn, (*ast.IfStmt)(nil))
return nil, nil
