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.