From 621747412c3802a8ab09a18b818403fda90adccd Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 16 May 2023 03:45:10 +0200 Subject: Add note about `(*types.Scope).LookupParent` --- gocapturedrefrace.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gocapturedrefrace.go b/gocapturedrefrace.go index d8fc4ef..b4fe9db 100644 --- a/gocapturedrefrace.go +++ b/gocapturedrefrace.go @@ -108,6 +108,9 @@ func checkClosure(pass *analysis.Pass, funcLit *ast.FuncLit) { } } + // TODO: Use (*types.Scope).LookupParent with ident to find out + // whether a variable was defined in an outer scope. + pass.Reportf( ident.Pos(), "variable found %q", -- cgit v1.2.3