Go language: Skillfully use the Beego Framework's bee tool for hot-compile testing (not every time go run xxx.go ~)

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

For beginners of our go language, we like to learn to write small code while learning. After each write, we all want to see the results of the program, although the Go run tool is often easy to run and can see the results directly, but is it annoying to repeat this command every time?

Fortunately the Beego Framework provides a bee tool that would have been used for the hot compilation of the framework, but we trickery can also use it for our small test programs!

Run the following command first:

Go get Github.com/beego/bee

If no accident, should be in the $gopath/bin directory to automatically generate a bee run file, Windows should be Bee.exe (if there is an accident, should be the kind of problem, because I have been science online, so I do not know whether there will be such a problem. )

Switch to the directory you are testing, such as $GOPATH/src/test, create a new test file (the file name is arbitrary):

Package Mainimport ("FMT") func main () {FMT. Println ("Hello World")}

Then copy the Bee tool $GOPATH the/bin directory to this test directory, or add the $GOPATH/bin to the environment variable path (recommended).

On the command line, switch to the test directory, run Bee run, and then you should know what's going on, or try to modify the program to see what's going on.

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.