Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git Gocode工具错误_Git_Go - Fatal编程技术网

Git Gocode工具错误

Git Gocode工具错误,git,go,Git,Go,我想安装gocode,但每当我尝试以下命令时:go get-u github.com/nsf/gocode 我得到以下错误: error: Your local changes to the following files would be overwritten by merge: autocompletecontext.go autocompletefile.go decl.go emacs-company/README.md emacs-company/company-go.el pack

我想安装gocode,但每当我尝试以下命令时:go get-u github.com/nsf/gocode

我得到以下错误:

error: Your local changes to the following files would be overwritten by merge:
autocompletecontext.go
autocompletefile.go
decl.go
emacs-company/README.md
emacs-company/company-go.el
package.go
package_bin.go
package_text.go
utils.go

Please commit your changes or stash them before you merge.Aborting Updating 46e8fd2..5070dac package github.com/nsf/gocode: exit status 1

那么如何强制合并或覆盖列出的文件呢。谢谢

我不知道您为什么要更改
gocode
存储库,但您可以根据需要执行以下两项操作之一

您不在乎本地的变化:

cd $GOPATH/src/github.com/nsf/gocode
git checkout -- .
go get -u github.com/nsf/gocode
cd $GOPATH/src/github.com/nsf/gocode
git stash
go get -u github.com/nsf/gocode
git stash apply
在这里,您将删除本地更改,然后更新
gocode
,这样就不再存在合并冲突

出于某种原因,您希望保留本地更改:

cd $GOPATH/src/github.com/nsf/gocode
git checkout -- .
go get -u github.com/nsf/gocode
cd $GOPATH/src/github.com/nsf/gocode
git stash
go get -u github.com/nsf/gocode
git stash apply

这是您的更改,并在更新代码后再次应用它们。

您使用的是哪个版本的go?与go无关:一个简单的git问题。我使用的是版本1.7。我想将autocomplete插件添加到GOLANG的Atom编辑器中,它需要gocode才能工作。