Slide 8
Slide 8 text
Types and Variables
Go has many simple types:
i
n
t
, i
n
t
8
, i
n
t
1
6
, i
n
t
3
2
, i
n
t
6
4
u
i
n
t
, u
i
n
t
8
, u
i
n
t
1
6
, u
i
n
t
3
2
, u
i
n
t
6
4
, u
i
n
t
p
t
r
f
l
o
a
t
3
2
, f
l
o
a
t
6
4
c
o
m
p
l
e
x
6
4
, c
o
m
p
l
e
x
1
2
8
b
o
o
l
, b
y
t
e
, r
u
n
e
, s
t
r
i
n
g
, e
r
r
o
r
But these are the ones you'll use most often:
i
n
t
, f
l
o
a
t
6
4
, b
o
o
l
, b
y
t
e
, s
t
r
i
n
g
, e
r
r
o
r
i
n
t
and u
i
n
t
are the natural or most efficient size for integers on a particular
platform, either 32 or 64 bits.
All types have a zero value, which is used to initialize variables. 0
for numbers, f
a
l
s
e
for booleans, "
"
for strings and n
i
l
for everything else.