Go Language Program Structure

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Go program mainly consists of the following parts:
Package Declaration
Importing packages
Function
Variable
Statements and expressions
Comments
An example of test20150525.go in one of these articles:

/* The first line defines a package. You must declare what package to run for the Go program. The main package is the starting point to run the program. Each package has a path and name associated with it. */package main/* Import "FMT" is a preprocessing command that tells the compiler to go to include files in the package fmt. */import "FMT"/* func main () primary function is the beginning of the execution of the program. */func Main () {//Note println method. In the Go language, a name if it starts with an uppercase letter for export. Export refers to a function or variable/common access to the corresponding package import. Fmt. Printf ("Hello world!\n God Bless you!"); }

Genesis 14:13 and there came one that had escaped, and told Abram the Hebrew; For he dwelt in the plain of Mamre the Amorite brother of Eshcol, and brother of Aner; and these were Confederate with ABR Am.

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.