Google hasn't officially released the go language compiling environment on the Windows platform. However, if you want to use the go language, you can try writing
Port version
Download:
Go-1.zip
Environment Settings:
Set goroot = <The go folder> <br/> set GOOS = mingw <br/> set goarch = 386
For example, I installed it in the following directory:
F:/tool/go-1/go/
The settings are as follows:
C:/> set goroot = F:/tool/go-1/go/
C:/> set GOOS = mingw
C:/> set goarch = 386
C:/> set Gobin = F:/tool/go-1/go/bin
Compilation exampleProgram
Enter a program in notepad and save it as hello. Go.
Package main
Import "FMT"
Func main (){
FMT. printf ("Hello, world! /N ");
}
Enter
8g hello. Go
Compile and output the hello.8 file.
Connect to the file to generate an executable file
8l-O hello.exe hello.8
Connection output hello.exe
The output of hello.exe is as follows:
Hello, world!
The entire process is as follows:
F:/go> 8g hello. Go
F:/go> 8l-O hello hello.8
F:/go> hello.exe
Hello, world!