aboutsummaryrefslogtreecommitdiffstats
path: root/testdata
diff options
context:
space:
mode:
authorTeddy Wing2023-05-15 02:27:38 +0200
committerTeddy Wing2023-05-15 02:27:38 +0200
commit47f01bb1f6e75a071c6ee9c7e070b0c03634be40 (patch)
treed61246fd7d78c3418a9223b3c1fe4626d59458c8 /testdata
parent6d91d473f24d6825170e494852b26ffc748fe542 (diff)
downloadgocapturedrefrace-47f01bb1f6e75a071c6ee9c7e070b0c03634be40.tar.bz2
Find variables in `go func` closures
Inspect function literals run by `go` statements, and find all variables in those function literals.
Diffstat (limited to 'testdata')
-rw-r--r--testdata/simple.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/testdata/simple.go b/testdata/simple.go
index 496be52..4b4c23a 100644
--- a/testdata/simple.go
+++ b/testdata/simple.go
@@ -2,8 +2,10 @@ package main
func main() {
capturedReference := 0
+ capturedReference2 := 1
go func() {
capturedReference += 1
+ capturedReference2 += 1
}()
}