July 2019
Intermediate to advanced
458 pages
12h 12m
English
Beside the basic types, there are others, which are known as composite types. These are as follows:
| Type | Description | Example |
| Pointer | The address in the memory of a variable | *int |
| Array | A container of the element of the same type with a fixed length | [2]int |
| Slice | Contiguous segment of an array | []int |
| Map | Dictionary or associative array | map[int]int |
| Struct | A collection of fields that can have different types | struct{ value int } |
| Function | A set of functions with the same parameters and output | func(int, int) int |
| Channel | Type pipes that are used for the communication of elements of the same type | chan int |
| Interface | A specific collection of methods, with an underlying value that supports them | interface{} |
The empty ...
Read now
Unlock full access