Skip to content

Commit

Permalink
Ignore _ variable
Browse files Browse the repository at this point in the history
  • Loading branch information
karimodm committed Oct 31, 2023
1 parent efa5302 commit a8f35c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/code-analysis/detect_captured_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func main() {
return true
}

if ident.Name == "_" { // skip underscore variables
return true
}

if ident.Obj == nil || ident.Obj.Kind != ast.Var {
return true
}
Expand Down

0 comments on commit a8f35c6

Please sign in to comment.