diff options
author | Teddy Wing | 2023-05-15 02:57:18 +0200 |
---|---|---|
committer | Teddy Wing | 2023-05-15 02:57:18 +0200 |
commit | 567f4e859ad48c9e2b01559f771cd20103c7903c (patch) | |
tree | d8a1248c47e568e255f492589896b0c3c3990ca6 /gocapturedrefrace.go | |
parent | 73ca10c35a486a124548cd4141ed174683bc4fdb (diff) | |
download | gocapturedrefrace-567f4e859ad48c9e2b01559f771cd20103c7903c.tar.bz2 |
Find out how to get closure arguments
Diffstat (limited to 'gocapturedrefrace.go')
-rw-r--r-- | gocapturedrefrace.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gocapturedrefrace.go b/gocapturedrefrace.go index 1e00d21..9544d48 100644 --- a/gocapturedrefrace.go +++ b/gocapturedrefrace.go @@ -51,6 +51,12 @@ func run(pass *analysis.Pass) (interface{}, error) { } func checkClosure(pass *analysis.Pass, funcLit *ast.FuncLit) { + fmt.Print("Params: ") + for _, field := range funcLit.Type.Params.List { + fmt.Printf("%#v, ", field.Names[0].Name) + } + fmt.Println() + ast.Inspect( funcLit, func(node ast.Node) bool { |