I'm trying to static analyze Go files. For this I need to parse variables of the following format:
shape.color = color.red
I need to find all variables accessed with dot notation. For example, I need to know that shape variable has the color attribute. And also need that color variable has red attribute. Im trying to use the go/ast and go/parser package but cant figure out a way to do it.
N.B. If it's something like shape.color() i.e, a method, then it shouldn't be counted