You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Autofix produces invalid syntax for else if err := ...; err != nil #9
The suggested fix inserts the assignment right before ifStmt.Pos(). When the if is an else if branch, the insertion lands between else and if, producing code that doesn't compile.
Don't emit a SuggestedFix when the ifStmt is the Else branch of a parent *ast.IfStmt (e.g. walk with inspector.WithStack and check the parent node) — report the diagnostic message only. Alternatively, rewrite the whole else if chain, but that's much more involved.
Activity