aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2023-05-17 19:20:08 +0200
committerTeddy Wing2023-05-17 19:20:08 +0200
commit58a0e1906d669a5a7c4e7f0ca4308a8af859880a (patch)
treec43f3725245cd1716802820cb6d7ab8ea500861a
parent25c10d21af917a01714930e19e3188f07bf098d5 (diff)
downloadgocapturedrefrace-58a0e1906d669a5a7c4e7f0ca4308a8af859880a.tar.bz2
Add notes about false positives that should be corrected
-rw-r--r--gocapturedrefrace.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/gocapturedrefrace.go b/gocapturedrefrace.go
index 10ab437..1521ed0 100644
--- a/gocapturedrefrace.go
+++ b/gocapturedrefrace.go
@@ -51,6 +51,8 @@ func run(pass *analysis.Pass) (interface{}, error) {
// Inspect closure argument list.
for _, arg := range funcLit.Type.Params.List {
+ // TODO: Ignore closures passed as arguments.
+
// Report reference arguments.
_, ok := arg.Type.(*ast.StarExpr)
if !ok {
@@ -106,6 +108,8 @@ func checkClosure(pass *analysis.Pass, funcLit *ast.FuncLit) {
return true
}
+ // TODO: Ignore shadowing variables.
+
// Identifier was defined in a different scope.
if funcScope != scope {
pass.Reportf(