1. ubuntu install go language
sudo apt-get install Golang
2. Test Go
mkdir Code//Create a command for a folder named code
Vim test.go//command to create a go file named Test under VIM
Press I to enter insert mode, edit code
/*************************************************************************> File name:test.go> Author:acway > Created time:2015 January 10 Saturday 15:23 29 seconds *********************************************************************** */package mainimport "FMT" Func Main () {FMT. Println ("Hello word!\n");}
Press ESC to exit insert mode
: Wq//Save and Exit Vim command
Compiling go Programs
Go build test.go//Compile Test.go program
You can then enter the LS command to find an executable file named Test.
Enter "./test" to execute this file, the program run results can appear
Run Go Program
Go run test.go//Run Test.go Program
Ubuntu Install Go language compilation environment