Go language hello. Go

Source: Internet
Author: User
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.

 

 

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.