diff options
author | Teddy Wing | 2023-05-18 04:00:54 +0200 |
---|---|---|
committer | Teddy Wing | 2023-05-18 04:00:54 +0200 |
commit | 4c92bfe81e049f38ee00f575f190d0b0e0b21305 (patch) | |
tree | 09b38e90c5b2be60272cb4968cad3181425a2dd3 | |
parent | a0e54f27ebad9c46112a36dfed7b0d4b4e8da99b (diff) | |
download | gocapturedrefrace-4c92bfe81e049f38ee00f575f190d0b0e0b21305.tar.bz2 |
checkClosure: Update `localAssignments` variable name
Now that the slice contains both assignment and declaration identifiers,
update the variable names to be more representative.
-rw-r--r-- | gocapturedrefrace.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gocapturedrefrace.go b/gocapturedrefrace.go index f53e4d3..c9b5642 100644 --- a/gocapturedrefrace.go +++ b/gocapturedrefrace.go @@ -86,7 +86,7 @@ func checkClosure(pass *analysis.Pass, funcLit *ast.FuncLit) { // Build a list of assignments local to funcLit. These will be ignored as // shadowed variables. - localAssignments := findLocalVarDeclarations(pass, funcLit) + localVarDeclarations := findLocalVarDeclarations(pass, funcLit) ast.Inspect( funcLit, @@ -101,8 +101,8 @@ func checkClosure(pass *analysis.Pass, funcLit *ast.FuncLit) { } // Ignore shadowed variables. - for _, localAssignmentIdent := range localAssignments { - if ident == localAssignmentIdent { + for _, declarationIdent := range localVarDeclarations { + if ident == declarationIdent { return true } } |