Install gocode - Go语言中文社区

Install gocode


1. D:AWS_workspaceDAAS_Go>go get -u -ldflags -H=windowsgui github.com/nsf/gocode

2. Then gocode.exe will be installed in "D:AWS_workspaceDAAS_Gobin"

3. In Eclipse->Goclipse, set executable of  gocode as this "D:AWS_workspaceDAAS_Gobingocode.exe".

 

See details in https://github.com/nsf/gocode

 =============

http://hao.jobbole.com/gocode/

 

gocode是go语言自动补全守护程序

687474703a2f2f6e6f736d696c65666163652e72752f696d616765732f676f636f64652d73637265656e73686f742e706e67687474703a2f2f6e6f736d696c65666163652e72752f696d616765732f656d6163732d676f636f64652e706e67

提供各种高级特性,目前包括

上下文敏感的自动补全

这个程序被称为守护进程是因为它使用了客户端服务器的架构,自动补全的速度特别快,热缓存的自动补全时间仅仅为30ms,几乎感觉不到。

使用

1,  首先你已经安装了go语言环境和设置了$GOPATH,保证你的 $PATH包含了 $GOPATH/bin

 

2  你需要一个合适的gocode版本,  6g/8g/5g的go编译器,你需要

go get -u github.com/nsf/gocode (-u flag for “update”)

windows 用户需要

go get -u -ldflags -H=windowsgui github.com/nsf/gocode

3  下面要做的是和你使用的编辑器相关的了,

Vim

1 从$GOROOT/misc/vim目录中安装Go的vim脚本

 

2  安装gocode  vim脚本

vim/update.sh

update.sh脚本干以下事情

当然你也可以使用symlink.sh来避免每次gocode升级后都要运行update.sh

symlink.sh 干以下事情

保证vim  开启了filetype插件,  .vimrc中加上filetype plugin on就行了

现在就可以自动补全了  使用  <C-x><C-o> 开启自动补全

使用 Vundle

在你的 .vimrc 中加上

运行:PluginInstall

Emacs

1   安装 auto-complete-mode

2  从gocode  源文件中拷贝emacs/go-autocomplete.el到你的 emacs的 load-path 目录中

3  在你的.emacs 中加上

github网址https://github.com/nsf/gocode

 

 

==========================================

 

http://blog.csdn.net/patch/article/details/10126281

golang环境安装配置

go的安装比较简单,下载exe直接执行就可以

windows环境变量里的配置说下

GOROOT  C:Go

GOOS  windows

GOARCH  amd64

GOPATH  D:gotest

PATH 增加C:Gobin

安装msysgit

下载页面

一路next,默认装到C:msysgitmsysgit

安装gocode

运行msysgit安装目录下的git-cmd.bat,在打开的dos窗口运行

go get -u -ldflags -H=windowsgui github.com/nsf/gocode

会自动编译生成exe文件

gocode源码下载到D:gotestsrc

exe在D:gotestbin

将gocode.exe复制到C:Gobin

 

安装完成

 
 
版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/weixin_33909059/article/details/86054904
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢