Go Language Development environment Setup (Windows)
The Go Language development installation package under Windows
Official Download Address:
Https://code.google.com/p/go/downloads/list
Yun-Habitat Community download address: http://www.jb51.net/softs/237132.html
Go Language Civil Service network (with relevant references and documentation)
http://zh.golanger.com/
Method/Step
1. Download the Go Language Development Kit (download Address tool) under Windows on the Google Code project in the down language. There are zip and MSI installed versions with two downloads. (MSI installed version here, more convenient)
2, download an MSI installation file, run it. All the way next to the setup path here. If you need to change the installation path.
Note: Never have Chinese in the path. Otherwise, you will not be able to use the Go Language development tool normally.
3. Wait for installation to finish ....
Installation Successful
4, because the use of MSI installation files, the Go Language environment variable has been automatically set up.
Note: If the following HelloWorld program does not work correctly, or if you are using a ZIP package, you can refer to setting the environment variable here:
System Variable Name:
Goroot
Value:
Where Go is installed
System Variable Name:
Path
Append value:
;%goroot%\bin
5, after the installation of course to verify that the go has been properly installed:
Open command Prompt (Cmd.exe) in Windows to execute the command:
Go version
If you can display the go version as normal in the diagram, it is already installed on your computer.
6, let's test the Go language HelloWorld:
Code:
Package Main
Import "FMT"
Func Main () {
Fmt. Printf ("helloworld!")
}
Code Note:
Func Main () {
Can not be written
Func Main ()
{
This is not just code specification, or go syntax. Or you'll get an error.
7, save, compile, execute:
1. Save to a Xxx.go file (I save it here under C:\test.go)
2. Compile and execute commands at the command prompt:
Go build-o C:\test.exe C:\test.go
Or
Go Build C:\test.go
(Note: An EXE file with the output specified above has C:\test.exe, and the following will generate Test.exe (possibly not C:\test.go location) under the current path.
3. Execute, execute the command at the command prompt:
Test.exe
You can see the helloworld! on the screen.
8, to this step, go language development environment to build and preliminary discussion is over.
End
Attention matters
Step Two:
Note: Do not appear in Chinese in the installation path. Otherwise, you will not be able to use the Go Language development tool normally.
Fourth Step:
Note: If the following HelloWorld program does not work correctly, or if you are using a ZIP package, you can refer to setting the environment variable here:
System Variable Name:
Goroot
Value:
Where Go is installed
System Variable Name:
Path
Append value:
;%goroot%\bin
Sixth step:
Code Note:
Func Main () {
Can not be written
Func Main ()
{
This is not just code specification, or go syntax. Or you'll get an error.