码迷,mamicode.com
首页 > 其他好文 > 详细

Install gocode

时间:2016-06-03 06:32:22      阅读:377      评论:0      收藏:0      [点我收藏+]

标签:

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

2. Then gocode.exe will be installed in "D:\AWS_workspace\DAAS_Go\bin"

3. In Eclipse->Goclipse, set executable of  gocode as this "D:\AWS_workspace\DAAS_Go\bin\gocode.exe".

 

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

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

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

 

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

技术分享技术分享

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

上下文敏感的自动补全

这个程序被称为守护进程是因为它使用了客户端服务器的架构,自动补全的速度特别快,热缓存的自动补全时间仅仅为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:\go\test

PATH 增加C:\Go\bin

安装msysgit

下载页面

一路next,默认装到C:\msysgit\msysgit

安装gocode

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

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

会自动编译生成exe文件

gocode源码下载到D:\go\test\src

exe在D:\go\test\bin

将gocode.exe复制到C:\Go\bin

 

安装完成

 
 

Install gocode

标签:

原文地址:http://www.cnblogs.com/kungfupanda/p/5554972.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!