How to Open Definition in GoClipse

The Open Definition operation in a default installation of Go and GoClipse does not work. This functionality of being able to jump to the definition of a type or function is provided by a tool named godef.

  • Installing godef is easy:
$ go get -v github.com/rogpeppe/godef

This installs a godef binary in the $GOPATH/bin directory.

  • Open Window -> Preferences -> Go -> Tools and set the path to the godef binary here.

  • Restart Eclipse. Right-click on any member or function and choose Open Definition, it should work now!

Note that GoClipse still does not provide the useful feature of showing details of a type or function in tooltip when you hover over something in the source file.

Tried with: GoClipse 0.14.1, Eclipse 4.5.2, Go 1.6.2 and Ubuntu 14.04

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s