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.