diff options
author | Teddy Wing | 2023-05-16 03:00:24 +0200 |
---|---|---|
committer | Teddy Wing | 2023-05-16 03:00:24 +0200 |
commit | c5a5153e6abfffbedc55e24ec505b1420660b5e3 (patch) | |
tree | fc5e5d77b09e398128d7c8ad004959428d27d9e2 | |
parent | cfb5c2d1a36017eb04cb9f94a3d027fb7616464b (diff) | |
download | gocapturedrefrace-c5a5153e6abfffbedc55e24ec505b1420660b5e3.tar.bz2 |
Idea for getting the scope of the closure
Just results in nil.
-rw-r--r-- | gocapturedrefrace.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gocapturedrefrace.go b/gocapturedrefrace.go index f8c328f..4187918 100644 --- a/gocapturedrefrace.go +++ b/gocapturedrefrace.go @@ -56,6 +56,10 @@ func run(pass *analysis.Pass) (interface{}, error) { return true } + // scope := pass.TypesInfo.Scopes[funcLit] + scope := pass.TypesInfo.Scopes[goStmt] + fmt.Println("scope:", scope) + checkClosure(pass, funcLit) return true |