This is a creation in Article, where the information may have evolved or changed.
The GO language is a lot of web frameworks, relatively speaking, Beego framework, easy to get started, complete documentation (Chinese), powerful, this article with Beego example.
Beego provides detailed development documentation: http://beego.me/docs/intro/
1. Installing the Beego and Bee tools
The installation of the Beego is typically in the form of a Go installation package:
终端运行:go get github.com/astaxie/beego,安装在$GOPATH/src目录中
The Bee tool is a project created to assist in the rapid development of BEEGO projects, where you can quickly create projects, implement hot compilations, develop tests, and package releases from creation, development, and deployment with bee.
Terminal operation:go get github.com/beego/bee,安装完之后,bee可执行文件默认存放在$GOPATH/bin里面,所以需要把$GOPATH/bin添加到您的环境变量中,才可以进行下一步。
2. Create a new Web project
Performbee new myproject,但是注意该命令必须在 $GOPATH/src 下执行。最后会在 $GOPATH/src 相应目录下生成如下目录结构的项目:
MyProject├──Conf│└──App.Conf├──Controllers│└── Default.Go├──Main.Go├──Models├──Routers│ └── Router.├── static│ ├── Css│├── Img│ └── Js├── Tests│ └── Default_test.└── views └── Index.< Span class= "PLN" >tpl
3. Run the project
Open Liteide, load the project directory, run:
Website has started, we login http://localhost:8080/to see the effect