This is a creation in Article, where the information may have evolved or changed.
Windows platform
1. Download go Language Pack, unzip to C:\go
2. Added 2 global variables, modified 1 variables
1, variable name: Gopath variable Value: E:\go Go's compiled directory in E:\go this folder.
2, variable name: Goroot variable Value: C:\go Go's home directory in C:\go this folder.
3, in the variable name: Ptah, began to increase the C:\go\bin; remember to add '; ' at the end Semicolon.
3. Download and install notepad++5.6.8 (not to download address, Google on a large)
4. Configure the notepad++:
1, after the installation of notepad++, we also have to install a plug-in. The installation process is a plug-in-plugin manage-show Plugin Manager (Figure 1)
2, under the available menu, find a plug-in called Nppexec, select, click Install Installation. See.
3, plug-in installation, we want to set up the plug-in. See
4, the specific settings are as follows
5. Testing
Open notepad++, dot format-in UTF-8 no BOM format encoding, we want to write a go program in UTF-8 format. Here also note that before writing the program, must be used without BOM UTF-8 mode write, that is, the first change mode after the program, otherwise notepad++ will be in the default ANSI format encoding, the result is English is visible, and Chinese is garbled. The following is a well-written program, you can paste directly, (see):
Paste the following procedure into the notepad++:
package main import "fmt" func main() { fmt.Printf("你好,中国! Hello, World!\n") }
保存到e:\go(GOPATH 目录是存放本地的go文件里的)
6. Running
CD E:\go We'll go to the e-drive go directory.
Go Run hello.go
This completes the first Go language program, hello word!