Preface
The running environment is in Ubuntu. Follow the instructions on the official website for simple installation. This is not detailed here. There is no error in installation errors. Next I will write a hello. Go file based on the simple website.
CodeAs follows:
Package main
Import "FMT"
Func main (){
FMT. printf ("Hello, world ")
}
Run the following command:
6g hello. Go
6l hello.6
./6.out
Output result: Hello, world
Run the command to generate a 64-bit exe Program:
6l-O hello.exe hello.6
The size of the generated file is 1.1 MB. the following error is reported when the file is run in window 7 32 bits:
Program too big to fit memory.
The following describes how to generate 32 programs in a 64-bit operating system.
After finding the code, I haven't found it for a long time. However, in addition to 6 GB, gccgo can also be compiled, and the generated code is more efficient.