From 4c92bfe81e049f38ee00f575f190d0b0e0b21305 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 18 May 2023 04:00:54 +0200 Subject: checkClosure: Update `localAssignments` variable name Now that the slice contains both assignment and declaration identifiers, update the variable names to be more representative. --- gocapturedrefrace.go | 6 +++--- 1 file 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 } } -- cgit v1.2.3