Go Language Primer-install-write-run (i)

Source: Internet
Author: User
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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.