Go data type

Source: Internet
Author: User

One. Numeric type

1. Integer

1.1 unsigned integers: types that begin with u, representing positive integers and 0, Uint8,uint16,uint32,uint64

1.2 Signed integers: Int8,int16,int32,int64

1.3 According to the operating system Adaptive data type: Uint,int,intptr ( This is a common type )

For 32-bit systems

         Uint=uint32         Int=int32

UIntPtr is a 32-bit pointer to a 64-bit system

         Uint=uint64         Int=int64

UIntPtr is a 64-bit pointer

2. Floating-point numbers: According to the number of decimal points followed by

2.1 Single-precision floating-point number: float32

2.2 Double-precision floating-point number: float64

3. Imaginary numbers:

3.1 complex64

3.2 complex128

Two. String: (String)

(i) A number of important concepts

1. Use (double quotes "") or (') to describe

2. The escape character between the double quotes is escaped, and the escape character between the ' sign remains intact.

3. Consists of a single byte: A python-like list that can be manipulated with an index

(b) Operation of the string:

1. Ask for length

2. Get a character with an index

3. String merging

Three. Boolean type: (BOOL)

1. True/false

2. With: and/&&

Or: OR/| |

Non: NOT/!

3. None of the following can be used as a Boolean judgment after if. Null value: Nil 0 value: 0 null value: ""

Go data type

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.