Recently want to learn the go language, start with the most basic hello go, build the Go development environment
First, download Go package
Since there are often problems with the go official home visit, you can download it from the domestic image:
http://www.golangtc.com/
Second, configure environment variables
1, unzip the go package to any directory, my D:\SDE\go
2. Configure Goroot Path
3. Configure Path Path
4. Configure the Go Program working directory Gopath
After configuring the above environment variables, we can see whether the configuration is successful in the command Line window, where I use the Cygwin
Enter the Go version command
The Go version number shows the configuration is successful!
Third, create a new Main.go file in the working directory of the Gopath configuration, write the following code
1 Package Main 2 3 Import (4 "FMT"5)67func main () {8 FMT. Println ("Hello go!" ); 9 }
Iv. compile the Main.go file and generate the Main.exe file
V. Execute Main.exe file, program successfully output Hello go!
Win7 Configuring the Go Environment