Reputation: 24304
Suppose I have the following code in Go:
foo, bar := someFunc(baz)
I would like to create a Vim function to check type of foo
or bar
when editing a file.
Is there any tool or reliable source of information for functions from Go's packages I could use or? As for the functions declared in the file I'm editing I was thinking about simply parsing all the functions declared in that file.
Upvotes: 0
Views: 877
Reputation: 182609
You are looking for something like godef
If the -t flag is given, the type of the expression will also be printed. The -a flag causes all the public members (fields and methods) of the expression, and their location, to be printed also; the -A flag prints private members too.
I know it is being used by various vim and emacs scripts.
Upvotes: 3