Go language compiler (go-Windows) on Windows)

Source: Internet
Author: User

Go for Windows download: http://code.google.com/p/go-windows/, http://savechina.download.csdn.net/

DOS execution is required before use.
Set goroot = <The go folder>
Set GOOS = mingw
Sets goarch = 386
Set Path = <The go folder>/bin

Compile and execute the test. Go file.
8g test. Go // compile and generate test.8
8l test.8 // connect to produce 8.exe
8 // execute 8.exe

Example:

Package main
Import "FMT"
Func main (){
FMT. Print ("Hello, world \ n ")
}
 
Ensure that go files are stored in UTF-8 format without BOM characters.
1. Execute chcp 65001 in DOS // modifyCodeThe page is UTF-8; otherwise, compilation fails.
2. Change the DOS window font to new; otherwise, garbled characters are displayed.
3. The chcp does not seem to support batch file processing.
If you write a bat program for compilation and execution, failure is not a matter of your character.
4. For BOM details, see http://en.wikipedia.org/wiki/byte_order_mark. the editor notepad under Windows automatically adds three bytes at the beginning of the file when saving the UTF-8 file. The content is ef bb bf. You can use vim or notepad ++ to edit the code. If editplus is used, mark "do not add byte order to UTF-8 file" in tool-Parameter Selection-file. No editplus? You can write a go file to delete the three bytes starting with the specified file.

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.