Go Language Primer-Basic data types

Source: Internet
Author: User
One. Program Entities and Keywords

Any go language source files are made up of several program entities. in the Go language, variables, constants, functions, structs, and interfaces are collectively referred to as "program entities", and their names are collectively referred to as "identifiers".

Identifiers can be alphabetic characters, numbers, and underscores "_" that can be represented by any Unicode encoding. However, the initial letter cannot be a number or an underscore .

Note :

In the go language, our access control to program entities can only be implemented by their name .

Program entities with uppercase initials can be accessed by code in any code package.

Program entities whose initials are lowercase can only be accessed by code in the same code package.

The Go language also specifies a number of specific character sequences. They are called "keywords". Programmers cannot use keywords as identifiers.

The keywords for the Go language are shown in the following table:

Two. Variables and constants

Three. Name and width of integer type

Four. notation for integer type values

Five. Floating-point type

Six. Plural type

Seven. Byte and Rune

Eight. String type

Mooc

Go Language Primer-Basic data types

Related Article

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.