Gocode not working for specifically one of my packages
At first it works normally, but just stopped working altegether for my specific package for a while. (for other packages that don't depend on it, gocode works normally)
I used gocode -s -debug to see the problem, and it outputs a lot of these:
Import path "github.com/phaikawl/wade/services/http" was not resolved
it even outputs these silly things:
Import path "fmt" was not resolved
Import path "reflect" was not resolved
I tried gocode drop-cache, but nothing changes.
Full log at https://gist.github.com/phaikawl/4c562f7264070bd1dd5c.
My full package code is at https://github.com/phaikawl/wade in case you want to test it.
Well, if it can't find standard packages, most likely something is wrong with Go installation.
What go env says?
I think there's nothing wrong with Go installation, because it WORKS for ALL other packages that don't depend on that one package. I have been using it (in LiteIDE) for a long time and there's no problem. Anyways here is go env:
GOARCH="386"
GOBIN=""
GOCHAR="8"
GOEXE=""
GOHOSTARCH="386"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/phaikawl/Dev/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_386"
TERM="dumb"
CC="gcc"
GOGCCFLAGS="-g -O2 -fPIC -m32 -pthread"
CXX="g++"
CGO_ENABLED="1"
I checked it on my machine by doing the same request you did in the log above for file: github.com/phaikawl/wade/promise.go. It works on my machine just fine. When I'm in NewPromise function and write h and do autocompletion it autocompletes it to http, then http members show up as well. See screenshot:

Although I'm on a 64 bit system, maybe that's the problem, but it seems unlikely to me. Maybe the package is not there for some reason? I clearly see mine:
[nsf @ ~]$ tree waytogo/pkg/linux_amd64/github.com/phaikawl
waytogo/pkg/linux_amd64/github.com/phaikawl
├── wade
│ └── services
│ └── http.a
└── wade.a
2 directories, 2 files
Maybe something is wrong with file permissions? Mine are fine:
[nsf @ ~]$ tree -pug waytogo/pkg/linux_amd64/github.com/phaikawl
waytogo/pkg/linux_amd64/github.com/phaikawl
├── [drwxr-xr-x nsf users ] wade
│ └── [drwxr-xr-x nsf users ] services
│ └── [-rw-r--r-- nsf users ] http.a
└── [-rw-r--r-- nsf users ] wade.a
2 directories, 2 files
There is no magic, if gocode says Import path "github.com/phaikawl/wade/services/http" was not resolved, then it wasn't able to find the file. And it looks in a lot of places. I asked you to print the environment, environment looks fine.
It's weird. Is there any sort of temporary storage, optimization or something that could cause errors? (I tried running gocode drop-cache already).
the vim view? i don't know if you have them enabled, but they could be the issue
@kurojishi no i'm not using vim to code this thing.
Gocode doesn't save anything on disk, except its config file, but as log shows, the lib-path option which may affect the package resolving is empty. So it's the default value. What go version are you using? go version
I seem to have a somewhat similar problem. Were you perhaps using a release candidate of Go 1.3 @phaikawl ?
My specific thing:
➜ interpreter git:(master) ls -la
total 12
drwxr-xr-x 2 player player 4096 Jun 20 20:44 .
drwxr-xr-x 15 player player 4096 Jun 20 20:44 ..
-rw-r--r-- 1 player player 588 Jun 20 20:44 interpreter.go
➜ interpreter git:(master) pwd
/home/player/go/src/bitbucket.org/aktau/ansible-go/interpreter
gocode debug output
2014/06/20 21:22:16 -------------------------------------------------------
2014/06/20 21:22:16 Import path "bitbucket.org/aktau/ansible-go/interpreter" was not resolved
2014/06/20 21:22:16 Gocode's build context is:
2014/06/20 21:22:16 GOROOT: /usr/lib/go
2014/06/20 21:22:16 GOPATH: /home/player/go
2014/06/20 21:22:16 GOOS: linux
2014/06/20 21:22:16 GOARCH: amd64
2014/06/20 21:22:16 lib-path: ""
2014/06/20 21:22:16 Import path "bitbucket.org/aktau/ansible-go/message" was not resolved
2014/06/20 21:22:16 Gocode's build context is:
2014/06/20 21:22:16 GOROOT: /usr/lib/go
2014/06/20 21:22:16 GOPATH: /home/player/go
2014/06/20 21:22:16 GOOS: linux
2014/06/20 21:22:16 GOARCH: amd64
2014/06/20 21:22:16 lib-path: ""
@aktau Gocode doesn't parse source code of your package, it needs to be compiled.
I mean gocode uses compiled libraries to resolve stuff, that is the file something like: /home/player/go/pkg/linux_amd64/bitbucket.org/aktau/ansible-go/interpreter.a
@nsf it is indeed true that the package in question is not where it should be according to you:
➜ pkg pwd
/home/player/go/pkg
➜ pkg tree
.
└── linux_amd64
├── code.google.com
│ └── p
│ └── go.net
│ └── websocket.a
├── github.com
│ ├── ActiveState
│ │ ├── tail
│ │ │ ├── ratelimiter.a
│ │ │ ├── util.a
│ │ │ └── watch.a
│ │ └── tail.a
│ ├── cloudfoundry
│ │ └── gosigar.a
│ └── howeyc
│ └── fsnotify.a
├── gopkg.in
│ └── tomb.v1.a
└── launchpad.net
├── goyaml.a
└── tomb.a
Perhaps the behaviour of the go toolchain changed? I use go build -o go-app && ./go-app to build and test any go project I'm working on while I'm in vim.
What should I do to force Go to compile these things? I'm going to look around on the system to see if these packages are anywhere else...
UPDATE:
➜ pkg sudo find / -name 'interpreter.*'
/home/player/go/src/bitbucket.org/aktau/ansible-go/interpreter/interpreter.go
/home/player/go/src/bitbucket.org/aktau/ansible-go/client/interpreter.go
/home/player/go/src/bitbucket.org/aktau/ansible-go/server/interpreter.go
It's getting stranger and stranger.
go build doesn't install libraries, use go install.
go build doesn't install libraries, use go install.
go install indeed does the trick. Yet, I haven't changed my edit-test cycle since I started coding in Go (when 1.1 was released), and I distinctly remember this not being a problem. I could Imagine that I did go install at some point in the project but I also (seem to) remember that I could autocomplete new methods very soon after I wrote them (after my first compile (go build -o go-app && ./go-app) of them). Am I hallucinating?
What do you use @nsf, do you always just go install?
Yes, I use go install mostly. Occasionally go build to check syntax correctness, but not every often.