Golang built-in types and functions

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

/* Built-in type
Value type:
bool
int (+ or), Int8, Int16, Int32, Int64
UINT (+ or), Uint8 (Byte), UInt16, UInt32, UInt64
float32, float64
String
Complex64, complex128
Array--fixed-length arrays

Reference type: (pointer type)
Slice--sequence array (most commonly used)
Map--Mapping
Chan--Pipeline

Built-in functions
Append--add things to slice and return to the modified slice
Close--closing channel
Delete-Deletes the value corresponding to the key from the map
Panic-Stop the regular goroutine
Recover--Allows the program to define Goroutine panic actions
Imag--Return to the real part of complex
Real--return to the imaginary part of complex
Make-Returns the type itself (applies only to slice, map, channel)
New--Returns a pointer to type
Cap--capacity, volume capacity
Copy--copies slice, returns the number of copies
Len--Return length

Built-in interface error

Type error Interface {//implements the Err interface as long as the error () function is implemented and the return value is string

Error () String

}

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.