Go语言Revel框架 准备工作

一、安装Go

参考下面几篇文章:

http://golang.org/doc/install

http://www.cnblogs.com/ghj1976/archive/2013/01/16/2863142.html

二、设置GOPATH

参考下面几篇文章:

http://www.cnblogs.com/ghj1976/archive/2013/03/24/2979668.html

http://www.cnblogs.com/ghj1976/archive/2013/02/16/2913350.html

三、安装 git 和 hg

go get 克隆依靠 Git 和 Mercurial

参考:http://www.cnblogs.com/ghj1976/archive/2013/03/08/2949237.html

四、获得 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.

NewImage

参考资料:

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

原文地址:https://www.cnblogs.com/ghj1976/p/2979709.html