Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GOCODE DOES NOT WORK WITH OR WITHOUT GOMODULES ENABLED #537

Open
p554157atch opened this issue Aug 20, 2020 · 6 comments
Open

GOCODE DOES NOT WORK WITH OR WITHOUT GOMODULES ENABLED #537

p554157atch opened this issue Aug 20, 2020 · 6 comments

Comments

@p554157atch
Copy link

This error shows up constantly all the time, tried to solved it for 10 hours but does not work:

Error parsing input file (outer block):
2020/08/20 07:26:52  /mnt/data/data/go/src/private/pgtableinvoice/pgtableinvoice.go:323:9: expected selector or type assertion, found ';'
2020/08/20 07:26:52 gbimporter: no package found for ./commonmessage: can't find import: "/mnt/data/data/go/src/private/pgtableinvoice/commonmessage"
2020/08/20 07:26:52 gbimporter: no package found for ./logger: can't find import: "/mnt/data/data/go/src/private/pgtableinvoice/logger"
2020/08/20 07:26:52 gbimporter: no package found for ./postgresdb: can't find import: "/mnt/data/data/go/src/private/pgtableinvoice/postgresdb"

go version go1.14.5 linux/amd64

Want to re-produce it yourself?
Just install Spacemaces from develop or master branch, your gocode won't give 1 correct suggestion for imported packages whether or not they are using gomodules.

@cixtor
Copy link

cixtor commented Aug 20, 2020

@p554157atch read the README again:

VERY IMPORTANT: this project is not maintained anymore, look for alternatives or forks if you need Go autocompletion tool

The majority of Go developers in the community switched to gopls more than a year ago. I suggest you to do the same.

@p554157atch
Copy link
Author

Spacemacs company-mode, that calls company-go is still using gocode for its output.
This is supposed to work with GOMODULES disabled.

@p554157atch
Copy link
Author

@mdempsky
Copy link

You can try https://github.com/mdempsky/gocode if you don't need modules support, or https://github.com/stamblerre/gocode if you do.

But long term, you should probably look into switching from company-mode to lsp-mode (with gopls), or ask spacemacs to look into this.

@cixtor
Copy link

cixtor commented Aug 20, 2020

@p554157atch the fact that you are using company-mode is irrelevant. Gocode was marked as “unmaintained” by the author so you should not expect them to fix the problems you are having on Spacemacs. As I suggested before, you should switch to gopls like the rest of the Go developers in the community. Please refer to this issue on spacemacs that was opened specifically to discuss problems with company-go. There you will find that other people have suggested to replace company-mode with lsp-mode which works with gopls (both with and without Go modules).

@benjamin-rood
Copy link

@cixtor Or, crazy idea, the go layer and the defaults could be fixed to have that configuration out of the box? Or at least the go layer documentation could be taken down as it is outrageously incorrect and out-of-date?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants