| 类型 | 长度(字节) | 默认值 | 说明 |
|---|---|---|---|
| bool | 1 | false | |
| byte | 1 | 0 | unit8 |
| rune | 4 | 0 | Unicode Code Pont, int32 |
| int, uint | 4或8 | 0 | 32或64位 |
| int8, unit8 | 1 | 0 | -128~127, 0~255, byte是uint8的别名 |
| int16, uint16 | 2 | 0 | -32768~32767, 0~65535 |
| int32, uint32 | 4 | 0 | -21亿~21亿, 0~42亿, rune是int32的别名 |
| int64, uint64 | 8 | 0 | |
| float32 | 4 | 0.0 | |
| float64 | 8 | 0.0 | |
| complex64 | 8 | ||
| complex128 | 16 | ||
| unitptr | 4或8 | 以存储指针的uint32或uint64整数 | |
| array | 值类型 | ||
| struct | 值类型 | ||
| string | "" | 值类型,UTF-8 字符串 | |
| slice | nil | 引用类型 | |
| map | nil | 引用类型 | |
| channel | nil | 引用类型 | |
| interface | nil | 引用类型,接口 | |
| function | nil | 函数 |