nsf / gocode

An autocompletion daemon for the Go programming language
MIT License
5.01k stars 656 forks source link

"go get -u github.com/nsf/gocode" don't do anything for me. #359

Open hzh8311 opened 8 years ago

hzh8311 commented 8 years ago

As the title, when I run the command, it do nothing for me. And I set the $GOPATH, but there is nothing inside $GOPATH/src/github.com . And there is also no hint after run the command.

dmitshur commented 8 years ago

Are you able to install any other Go packages successfully?

If not, it sounds like your Go installation is broken. I would recommend removing Go and installing it again. See https://golang.org/doc/install.

go get -u github.com/nsf/gocode works okay for me.

hzh8311 commented 8 years ago

It doesn't work for other package either. And I work on Ubuntu 16.04 and I installed the golang-go by aptitude, Does it better installed by the package on the website you give above?

dmitshur commented 8 years ago

Yes, I would highly recommend installing Go from its website rather than a package manager. In most cases, it's much easier, more up to date, and works flawlessly.

Don't forget to remove your previous installation of Go from aptitude first.

Also, make sure you have git installed, since Go uses that to fetch git repositories.

dmitshur commented 8 years ago

It's also really easy. On Linux, you can simply do:

# Install Go on Linux.
curl -L https://golang.org/dl/go1.8.1.linux-amd64.tar.gz | sudo tar zx -C /usr/local/

# Add to ~/.bash_profile.
export PATH="$PATH:/usr/local/go/bin:$HOME/go/bin"

Edit: Updated for Go 1.8.1. It's even easier now, because one can rely on default value of GOPATH instead of having to set it.

holtzermann17 commented 7 years ago

You should

export PATH="/usr/local/go/bin:$GOPATH/bin:$PATH"

so that the newly installed version will be used rather than some other version that might be on your path.

dmitshur commented 7 years ago

It's probably even better to uninstall some older version rather than sweep it under the rug. My instructions were for a clean Linux installation that does not have Go installed.

CapitanShinChan commented 6 years ago

I have a similar problem in a Windows 10 machine. I could install many other tools without any problem, but gocode keeps failing.

image

image

image

I tried to add the GOPATH to the system PATH variable, but I'm getting the same error: image

nitishbhushan2013 commented 6 years ago

In fact I am also on the same boat. I installed golang on window 7. Installation is successful. But Go extension on VS code keeps failing.

Installing github.com/nsf/gocode FAILED. Almost all the packages are failing. Installing github.com/uudashr/gopkgs/cmd/gopkgs FAILED Installing github.com/ramya-rao-a/go-outline FAILED Installing github.com/acroca/go-symbols FAILED Installing golang.org/x/tools/cmd/guru FAILED Installing golang.org/x/tools/cmd/gorename FAILED Installing github.com/acroca/go-symbols FAILED Installing golang.org/x/tools/cmd/guru FAILED Installing golang.org/x/tools/cmd/gorename FAILED Installing github.com/acroca/go-symbols FAILED Installing golang.org/x/tools/cmd/guru FAILED Installing golang.org/x/tools/cmd/gorename FAILED Installing github.com/fatih/gomodifytags FAILED

flip1688 commented 6 years ago

If you installed from .msi delete your go directory and reinstall by using .zip

99zombies commented 5 years ago

Have same problem, "go get" command not working on Ubuntu 19.0.1, all paths configured correctly. under = sudo nano ~./profile, and restart. Have run "go version" + "go env", they are working. Git version = 2.20.1 and Go version = 1.11, all latest versions.

dmitshur commented 5 years ago

@99zombies This is an old issue. There are different causes that can lead to the same outcome, and it's likely the people above had another instance of this problem.

I suggest looking through the page at https://golang.org/wiki/InstallTroubleshooting, and if you're still having no luck, try asking in one of the resources listed at https://golang.org/help.

SukumarMehta commented 5 years ago

FYI - I had the same issue - I resolved it by setting GOPATH to a valid path

UglyWillDuckling commented 4 years ago

For me, the problem was fixed by setting the value of the env variable GO111MODULE from "on" to "off". The variable was added to enable requiring a specific module version, read more https://dev.to/maelvls/why-is-go111module-everywhere-and-everything-about-go-modules-24k.

ugale-deepak3010 commented 3 years ago

go get -u github.com/nsf/gocode I am using this command does not return anything I am using windows10 platform I have git && github and also go version go1.16.3 windows/amd64 so plz anyone respond me if any solution