| Age | Commit message (Collapse) | Author | 
|---|
|  |  | 
|  | Discovered this existed. | 
|  | Not working, as `funcObj` is nil. | 
|  | Debugging and ideas for getting variables defined in this closure's
scope. | 
|  | Got this idea from a question by zhizhixiong
(https://stackoverflow.com/users/12073516/zhizhixiong) on Stack
Overflow:
https://stackoverflow.com/questions/66544145/how-to-find-the-declaration-of-an-ident-using-go-analysis
This seems to correctly print defines and assigns. It doesn't print the
`decl` variable though. | 
|  |  | 
|  | This field could maybe tell us whether it was a `:=` assignment
(token.DEFINE) or `=` (token.ASSIGN), but it seems like it's always
`token.DEFINE`. | 
|  | Turns out this only gets declarations like:
    var decl string
but not:
    decl := "a"
Is there a way to get the above one too? | 
|  | These should be reported as well, because they're shared references even
though they're passed as arguments.
This currently reports the variable name as "aStruct", will need to look
into how to correct that. | 
|  |  | 
|  |  | 
|  | Turns out this isn't what we want, as assignments means assignments. I
was actually thinking of declarations. | 
|  |  | 
|  | Don't report variables that were passed as arguments to the closure. | 
|  |  | 
|  |  | 
|  | This does ignore "strings" and "Repeat" in the "simple.go" test file. | 
|  | Need to refine our identifier filtering. | 
|  | We want to ignore local variables. | 
|  | Second usage of captured reference is reported as expected. That seems
correct for our needs. | 
|  | Inspect function literals run by `go` statements, and find all variables
in those function literals. | 
|  | Build a basic Go analyser that finds `go` statements.
Currently testing this with:
    $ go run ./cmd/gocapturedrefrace ./testdata/
Using the following tutorials as a guide:
* https://arslan.io/2019/06/13/using-go-analysis-to-write-a-custom-linter/
* https://scribe.rip/codex/writing-custom-linter-in-go-54ef6f8080 | 
|  |  |