This is a creation in Article, where the information may have evolved or changed.
1. Install Go
1.1. OS X
1.1.1, installation Homebrew
Run the following command in Terminal:
$ RUBY-E "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ Brew Update
1.1.2, install Go
$ Brew Install Go
1.2. Ubuntu
$ sudo apt-get update
$ sudo apt-get install go
1.3. Windows
Please download the installation package yourself
64bit Https://storage.googleapis.com/golang/go1.4.1.windows-amd64.msi
32bit Https://storage.googleapis.com/golang/go1.4.1.windows-386.msi
2. Configure the development environment
2.1. Configure Golang Environment
2.1.1, creating Go Path
Create a folder in a directory with permissions Go_path, the code directory for Golang
2.1.2, configuring environment variables
Edit File ~/.bash_profile (OS X) ~/.BASHRC (Ubuntu)
Increase as the downside
Export gopath={your Go_path path}
Export path= "$GOPATH/bin: $PATH"
2.1.3, loading environment variables
Run the following command in Terminal:
$ source ~/.bash_profile (OS X)
$ source ~/. BASHRC (Ubuntu)
2.2, download the dependency package
Go get Golang.org/x/tools/cmd/vet
Go get Golang.org/x/tools/cmd/godoc
Go get Github.com/nsf/gocode
Go get github.com/jstemmer/gotags
#MongoDB Client
Go get gopkg.in/mgo.v2
#Mysql Client
Go get Github.com/go-sql-driver/mysql
#Redis Client
Go get Github.com/garyburd/redigo/redis
2.3. Configure Revel Environment
Go get Github.com/revel/revel
Go get Github.com/revel/cmd/revel
2.4. Create Revel Application
Run the following command in terminal
$ revel New {Your domain name}/{app name}
Revel will create a web app in $gopath/src/{your domain name}/{app name}/directory
Run the following command in terminal and run the Web app on port 9000
$ revel Run {Your domain name}/{application name} PROD 9000
3. Revel Code Structure
Public/is the placement of static files such as Js/css/fonts/img
app/is the code directory
app/controllers/the source file where the controller layer is placed
app/views/Place the source file of the view layer
App/views/app/is the view that the controller corresponds to App/controllers/app.go