Hi,
I'm using go/ast (and token/types. etc) to parse a Go project, it all works well when my program only has one package, but there are times where I have code like this:
file-a.go
=========
package a
...
selector := b.Selector(CompanyID)
...
========
and then
file-b.go
========
package b
....
func Selector(n string) string{
...
}
========
Simple, in package a I call a function from package b, the issue is that when I'm walking the ast for pacakge a, I reach selector as an *ast.Ident and then I check
the .Obj value and it is nil.
Is there a way to "fill in" this information?
For now, the information I'm looking for is the Decl value,
I tried using
golang.org/x/tools/go/loader to solve this but it has the same issue, it doesn't "fill in" the missing information, it does give me a different way to access the declaration, but it also does a lot more work that I don't need and makes my too run slower.
Hope I was clear.
Thanks
Diego