设为首页 加入收藏

TOP

Install gocode
2017-09-30 13:46:05 】 浏览:7939
Tags:Install gocode

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语言自动补全守护程序

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:\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

 

安装完成

 
 
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇在windows下配置Eclipse + go环境 下一篇GoLang 的 daemonize 实现

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目