Go Language Installation and setup

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

Install under Windows:
Package Download Path: http://golangtc.com/download
DOS execution required before use
Set goroot=
Set Goos=mingw
Set goarch=386
Set Path=/bin

Compiling the execution of the Test.go file requires execution
8g Test.go//Compile build Test.8
8l Test.8//Connection Generation 8.exe
8//Execute 8.exe

Example

Package Main
Import "FMT"
Func Main () {
Fmt. Print ("Hello, world\n")
}

Chinese support needs to ensure that go files are stored in utf-8 format without BOM characters
1, DOS execution chcp 65001//Modify code page is utf-8, otherwise cannot compile
2, modify the DOS window font for the new Arial, otherwise display characters are garbled
3, after CHCP does not seem to support batch processing files.
If you write a bat to compile the execution, then the failure is not your character problem.
4, about the BOM, see Http://en.wikipedia.org/wiki/Byte_order_mark, the main idea is the editor under Windows Notepad when saving Utf-8 file will automatically add three bytes at the beginning of the file, Content for the EF BB BF. You can use Vim or notepad++ to edit the code. If you are using EditPlus, check the "Do not add byte order to UTF-8 file" in the tool-parameter selection-file. No editplus? Oh, write a go file to delete the beginning of the specified file three bytes on it.

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.