The Go Programming Language (Golang)

Source: Internet
Author: User

Basic type:

  • Numerical
    • Integral type: int int8 int16 int32 (Rune) Int64 uint Uint8 ((byte)) uint16 UInt32 UInt64 uintptr
      int, uint, uintptr is 32 bits on 32-bit system, 64-bit on 64-bit system
    • Float type: float32 float64
    • Plural type: complex64 complex128
  • String
  • Boolean: True False

<font color=red >note</font>: In the IF statement, if the test condition is I >= 0, then the type I is not suitable for the UINT type (UINT data always >= 0)

Operator:

  • The remainder is only used for integral type; the residue is the same as the dividend symbol, 5%3=2; -5%3=-2
  • 5.0/4=1.25;5/4.0=1.25;5/4=1
  • && if the expression on the left side evaluates to false, the expression on the right is not checked;& always verify expressions on both sides
  • With or ^; Unary prefix ^

Aggregation type (aggregate types):

1. Arrays

2. Structure

Reference type

1. Pointers

2. Slicing, mapping

3. Functions

4.channel

Interface 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.