Open hzh8311 opened 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.
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?
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.
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.
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.
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.
I have a similar problem in a Windows 10 machine. I could install many other tools without any problem, but gocode keeps failing.
I tried to add the GOPATH to the system PATH variable, but I'm getting the same error:
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
If you installed from .msi delete your go directory and reinstall by using .zip
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.
@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.
FYI - I had the same issue - I resolved it by setting GOPATH to a valid path
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.
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
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.