V tem menos tipos primitivos que Go.
bool pode ser true ou false
true
false
string
inteiro tipo int
int
float tipo float
float
rune (Unicode string)
arrays []
[]
map {}
{}
struct
O número inteiro é subclassificado em signed e unsigned. signed significa positivo ou negativo e não unsigned significa apenas positivo.
signed
unsigned
Tipo
Tamanho
Range
int8
8 bits
-128 to 27 -1
int16
16 bits
-215 to 215 - 1
32 bits
-231 to 231 - 1
int64
64 bits
-263 to 263 - 1
int128
128 bits
-2127 to 2127 - 1
byte
0 to 27 -1
u16
0 to 215 - 1
u32
0 to 231 - 1
u64
0 to 263 - 1
u128
0 to 2127 - 1
Last updated 5 years ago
Was this helpful?