0

I 've been using goclipse for a while. I never got the godef working in eclipse except for the definitions in the same file opened in the editor. I never bothered much but this time I thought I will get this fixed. But looks like no way I am able to get this working.

Even I tried 'godef' commandline in my repo even that doesn't seem to work.

If anybody familiar with godef could help me, that would be great.

basically, I have repo with dir structure like this. foo/a.go bar/b.go. Now from eclipse I open b.go and look for a definition in a.go. It just can't find it.

I tried command line godef -f bar/b.go foo.expr. It can't find. but it works as long as expr is in the b.go. for example - godef -f bar/b.go bas works as long as bas is in b.go

What is going wrong here? Does the godef only search for expr in the same file ?

joe
  • 1,136
  • 9
  • 17

1 Answers1

0

after too much scrambling I was able to get this fixed. So, here are the tips/hints if anyone runs in to this issue. The key is to make sure the all the project dependencies are resolvable from the project root.

Configure the GOPATH under project settings in goclipse such a way that it all dep. are resolvable as above.

My project have a build dir where the makefiles and build was happening, the GOPATH was set from that perspective. But goclipse/godef doesn't understand this.

I was able to figure this out with godef command line with '-debug' flag. It basically showed one dep (which I was not searching for) is not resolvable and it failed.

joe
  • 1,136
  • 9
  • 17