0
点赞
收藏
分享

微信扫一扫

Go语言Revel框架 准备工作

一、安装Go

参考下面几篇文章:

http://golang.org/doc/install


 

二、设置GOPATH

参考下面几篇文章:



 

三、安装 git 和 hg

go get 克隆依靠 Git 和 Mercurial

  • Installing Git
  • Installing Mercurial

参考:

 

四、获得 Revel framework

go get github.com/robfig/revel

如果没有设置 GOPATH,会下载到 GOROOT 目录下,否则下载到 GOPATH的第一个目录下。

 

参考:

 

五、编译 Revel 命令行工具

在你的 工作区 GOPATH 根目录下执行下面命令:

 

go build -o bin/revel github.com/robfig/revel/cmd

 

把编译好的文件放入 PATH 参数中,这样我们可以直接执行。

export PATH="$PATH:$GOPATH/bin" 
echo 'PATH="$PATH:$GOPATH/bin"' >> ~/.bash_profile


六、测试 Revel 安装情况

在命令行执行  revel help ,如果能看到下面信息,就能确保 Revel 安装好了。

 

$ revel help
~
~ revel! http://robfig.github.com/revel
~
usage: revel command [arguments]

 

The commands are:

 

new create a skeleton Revel application
run run a Revel application
build build a Revel application (e.g. for deployment)
package package a Revel application (e.g. for deployment)
clean clean a Revel application's temp files
test run all tests from the command-line

 

Use "revel help [command]" for more information.

Go语言Revel框架 准备工作_Go

 

参考资料:

http://robfig.github.com/revel/tutorial/gettingstarted.html

举报

相关推荐

0 条评论