diff options
author | Teddy Wing | 2023-05-15 02:46:12 +0200 |
---|---|---|
committer | Teddy Wing | 2023-05-15 02:46:12 +0200 |
commit | 73ca10c35a486a124548cd4141ed174683bc4fdb (patch) | |
tree | b19c1b43b24e53c804bffe0152b23326ca69addb | |
parent | 4e2286969f94f2c4fe6f1850e9b7a96d7e8167f2 (diff) | |
download | gocapturedrefrace-73ca10c35a486a124548cd4141ed174683bc4fdb.tar.bz2 |
Ideas for finding out whether a variable is a captured reference
-rw-r--r-- | gocapturedrefrace.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gocapturedrefrace.go b/gocapturedrefrace.go index 8f79d76..1e00d21 100644 --- a/gocapturedrefrace.go +++ b/gocapturedrefrace.go @@ -63,6 +63,9 @@ func checkClosure(pass *analysis.Pass, funcLit *ast.FuncLit) { return true } + // TODO: Find out whether ident is a captured reference + // Maybe check if variable was not assigned or passed as an argument? + pass.Reportf( ident.Pos(), "variable found %q", |