Golang (2): Beego Environment Construction

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/46695513 reprint please must indicate the source!

1, about Beego

Beego is a use of Go development framework, the idea comes from tornado, routing design from Sinatra, support the following features

Mvc,rest, intelligent routing, log debugging, configuration management, automatic template rendering, layout design
Middleware insertion logic, convenient json/xml service

Official website Http://beego.me

The website is very fancy.

2, headache of Gopath

Go from version 1.1 must set this variable, and not the same as the Go installation directory, this directory is used to store the go source, go executable files, as well as the corresponding compiled package files. So there are three subdirectories under this directory: src, bin, pkg.
I do not know why, I think gopath should be placed in a third-party class library, and it is best to share.
Fortunately Gopath can set multiple, let the first do the public class library, the second do the project.

Under Mac settings: (assuming/data/workspace_go/demo1
is the project directory, must be an absolute path)
Command-line modification: ~/.bash_profile

#set golang path export GOROOT=/usr/local/goexport GOPATH=/usr/local/go_path:/data/Workspace_go/demo1export PATH=$PATH:/usr/local/go_path/bin

Modify the system environment: ~/. Macosx/environment.plist

<?xml version= "1.0" encoding= "UTF-8"?><! DOCTYPE plist Public "-//apple//dtd plist 1.0//en" "Http://www.apple.com/DTDs/PropertyList-1.0.dtd" ><plist version="1.0"><dict>    <key>Gopath</key>    <string>/usr/local/go_path:/data/workspace_go/demo1</string>    <key>Goroot</key>    <string>/usr/local/go</string>    <key>PATH</key>    <string>$PATH: $/usr/local/go_path/bin</string></dict></plist>

Then install the environment: Http://beego.me/quickstart

getgetnew hellocd hellobee run hello

Then the project ran up:

3,idea Code Base Introduction

Although it can be compiled, Beego is not found in idea.
File, Project Structure add Classpath,sourcepath to/USR/LOCAL/GO_PATH/SRC.

Then the code can be identified. More convenient, and can look at the source code.

Detailed Documentation:
http://beego.me/docs/intro/

4, summary

The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/46695513 reprint please must indicate the source!

Beego is very convenient, from MVC to DAO all have, is another style, need to spend time to adapt, but small fresh much. It's much more agile to develop a web than Java. The development of a system is all understood.
There are also beego video materials:
Http://study.163.com/course/introduction/634003.htm

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.