类型 | 范围 |
bool | true false |
int32 | -2147483648 to 2147483647 |
int64 | -9223372036854775808 to 9223372036854775807 |
int8 | -128 to 127 |
int16 | -32768 to 32767 |
uint8 | 0 to 255 |
uint16 | 0 to 65535 |
uint(32) | 0 to 4294967295 |
uint(64) | 0 to 18446744073709551615 |
float32 | 1.401298464324817070923729583289916131280e-45 to 3.402823466385288598117041834516925440e+38 |
float64 | 4.940656458412465441765687928682213723651e-324 - 1.797693134862315708145274237317043567981e+308 |
string | |
complex64 | |
complex128 | |
array |
其他类型:
slice – 序列数组(最常用)
map – 映射
chan – 管道