aboutsummaryrefslogtreecommitdiffstats
path: root/gocapturedrefrace.go
diff options
context:
space:
mode:
Diffstat (limited to 'gocapturedrefrace.go')
-rw-r--r--gocapturedrefrace.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/gocapturedrefrace.go b/gocapturedrefrace.go
index e1f2d41..1353d7d 100644
--- a/gocapturedrefrace.go
+++ b/gocapturedrefrace.go
@@ -128,6 +128,11 @@ func checkClosure(
fmt.Printf("In function scope %v\n", scopeObj)
}
+ // Identifier is local to the closure.
+ if scope == nil && scopeObj == nil {
+ return true
+ }
+
if funcScope != scope {
pass.Reportf(
ident.Pos(),