This is a creation in
Article, where the information may have evolved or changed.
1. Go Download Address
Http://code.google.com/p/go-windows
2. Configure Environment variables
Select My Computer, right-click Properties, select Advanced tab, click Environment variable settings below
Add the following 4 environment variables in the system environment variable respectively
Goroot The Go installation path such as C:/go
Goos MinGW
Goarch 386
Path the bin path for go such as c:/go/bin (path variable is usually present, open directly, the semicolon in the first + half-width state, and then enter the bin path in front of the semicolon )
Once setup is complete
Enter cmd in the run
Then type:8g
See if you can find the path, if the command is not found problems, then congratulate you, the configuration is successful, if the prompt cannot find the command, then the configuration is not successful, you can set to configure the test, how there are problems, specifically can contact me, we discuss together (MSN alifel@live.cn )
3. Program Test
Open Notepad and enter the following code:
[CPP]View Plaincopyprint?
- Package Main
- Import "FMT"
- Func Main () {
- FMT. Printf ("I am very happy!" );
- }
Package <textarea style="DISPLAY: none" class="cpp" rows="15" cols="50" name="code">Mainimport "FMT" Func Main () {FMT. Printf ("I am very happy!");}</textarea>
Then save as mycoder.go ( suffix can be any )
Compiling the program
Switch to the path under the source code in CMD
(DOS command review: "cd/" to the root directory; "Drive letter:" Switch letter; "CD folder name" into the folder )
Input:8g mycoder.go(carriage return)
At this point, if the program normally produces a mycoder.8 file
Connection Program
Input:8l-o *.exe mycoder.8 return
(* represents the file name of the executable file generated after the connection, in which case the 8l-o MyCoder.exe mycoder.8)
If the program is OK, a MyCoder.exe file is generated
Run the program
Input:mycoder
Everyone will see the screen printed out I am very happy!
Now, the Go language development environment has been successfully configured