Go Language Development Web development, although the use of the go language itself can be implemented, but the need for rapid development of the novice still have some obstacles. The go language has thousands of open source projects, and there are also frameworks for web development, such as Revel/beego/iris. Beego
Beego's developers are the astaxie of China, a powerful web framework inspired by tornado and Sinatra and made easy to use. There are a lot of business users now.
installation
[ROOT@LIUMIAOCN beego]# export Gopath=/tmp/goprj/beego
[root@liumiaocn beego]# go get github.com/astaxie/beego
[root@liumiaocn beego]# go get Github.com/beego/bee
[ROOT@LIUMIAOCN beego]# export path= $PATH:/tmp/goprj/beego/bin
Create a project
[ROOT@LIUMIAOCN beego]# Bee new HELLOPRJ ___ | ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
\____/ \___| \___| v1.6.2 2017/01/31 16:02:02 WARN?
0001 You workdir is not inside $GOPATH/src. 2017/01/31 16:02:02 INFO? 0002 Creating Application ... create/tmp/goprj/beego/src/helloprj/create/tmp/goprj/beego/src/hellopr
j/conf/create/tmp/goprj/beego/src/helloprj/controllers/create/tmp/goprj/beego/src/helloprj/models/ Create/tmp/goprj/beego/src/helloprj/routers/create/tmp/goprj/beego/src/helloprj/tests/cre Ate/tmp/goprj/beego/src/helloprj/static/create/tmp/goprj/beego/src/helloprj/static/js/create/tm P/goprj/beego/src/helloprj/static/css/create/tmp/goprj/beego/src/helloprj/static/img/create/tmp/go Prj/beego/src/helloprj/views/create/tmp/goprj/beego/src/helloprj/conf/app.conf Create/tmp/goprj/bee Go/src/helloPrj/controllers/default.go CREATE/TMP/GOPRJ/BEEGO/SRC/HELLOPRJ/VIEWS/INDEX.TPL Create/tmp/goprj/beeg O/src/helloprj/routers/router.go Create/tmp/goprj/beego/src/helloprj/tests/default_test.go Create/tm P/goprj/beego/src/helloprj/main.go 2017/01/31 16:02:02 SUCCESS?
0003 NEW Application successfully created! [ROOT@LIUMIAOCN beego]# LL
Execute
[Root@liumiaocn helloprj]# pwd/tmp/goprj/beego/src/helloprj [root@liumiaocn helloprj]# Bee Run ___ | ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
\____/ \___| \___| v1.6.2 2017/01/31 16:04:16 INFO? 0001 Using ' helloprj ' as ' appname ' 2017/01/31 16:04:16 INFO?
0002 Loading Default configuration ... 2017/01/31 16:04:16 INFO?
0003 Initializing Watcher ... 2017/01/31 16:04:16 INFO? 0004 watching:/tmp/goprj/beego/src/helloprj/controllers 2017/01/31 16:04:16 INFO? 0005 watching:/tmp/goprj/beego/src/helloprj 2017/01/31 16:04:16 INFO? 0006 watching:/tmp/goprj/beego/src/helloprj/routers 2017/01/31 16:04:16 INFO? 0007 watching:/tmp/goprj/beego/src/helloprj/tests helloprj/controllers helloprj/routers helloprj 2017/01/31 16:04:18 SUCCESS?
0008 Built successfully! 2017/01/31 16:04:18 INFO?
0009 restarting ' helloprj ' ... 2017/01/31 16:04:18 SUCCESS?
0010 './helloprj ' is running ... 2017/01/31 16:04:18 [I] [asm_amd64.s:2086] http SerVer Running on http://:8080 2017/01/31 16:04:39 [D] [server.go:2202] | 192.168.32.1| 200 | 6.373568ms| match| get/r:/
Screen Confirmation
other
In addition to Beego, Revel is also widely used, there are many other open source excellent projects can see the following URL to learn.
Project |
URL |
Revel |
http://www.gorevel.cn/ |
Iris |
Https://github.com/kataras/iris |
Beego |
https://beego.me/ |
Open Source Projects |
Https://github.com/hackstoic/golang-open-source-projects |
Open Source Projects |
Http://www.open-open.com/lib/view/open1396063913278.html |