Golang Notes--data types

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

1, 25 keywords

Program declaration: Import, Package

Program entity declaration and definition: Chan, const, Func, interface, map, struct, type, var

Program Flow control: Go, select, break, case, continue, default, defer, else, Fallthrough, for, Goto, if, range, return

2. Type

18 Basic types: bool, String, Rune, byte, int, uint, int8, uint8, Int16, UInt16, Int32, UInt32, Int64, UInt64, float32, float64, C Omplex64, complex128

7 Composite types: Array, struct, function, interface, slice, map, channel

The declaration of a type begins with the type keyword, then a custom identifier name, followed by the name of the base type or the definition of a composite type.

3. Operator

List some special operators, such as <<, >>, &, &^,!, <-, etc.

4. Special NULL Identifier: _

5. Expression

A special expression has a type assertion, and if you determine the type of an expression X is T, the expression is X. (t), meaning that x is not nil and the value stored in it is type T. There are two cases where x is a value of an interface type, such as interface{} (100) if it is determined that 100 is of type int. (int); If x is not the value of the one-year interface type, then T is required to be an interface type, which means that assertion X implements the interface of T.

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.