This is a creation in Article, where the information may have evolved or changed.
1. Download the latest go for Windows release 2010-05-04 in Go Chinese forum
2. Unzip the download package under C drive.
3. Set environment variables.
Code:
- Set Goroot = C :/go
- Set Goarch = 386
- Set Path = C :/go/bin
- Set Goos = Windows
4. Write the first go Language program code.
Code:
- Package Main
- Import "FMT"
- Func Main () {
- FMT. Printf ("This was firstmy/n go program")
- };
Written in Notepad and saved as H.go, I saved it under C:/go/work.
5. Compile and run the H.go file
Run cmd, go to c:/go/work and enter separately
Code:
- 8g H.go
- 8l h.8
- 8.out
You can see that H.go compiles and runs successfully. You can also see that there are three files in the current directory
6.go language has yet to be improved, in Windows Chinese will be garbled, the official recommended notepad++ programming, has not yet tried, the final garbled problem I have not resolved. The Go directory Also
There are a lot of test examples.