Variables & Types

Basic Types

Go Basic Types 📊

Go has simple, well-defined types.

Numeric Types

TypeDescription
int
,
int8
,
int16
,
int32
,
int64
Integers
uint
,
uint8
, etc.
Unsigned integers
float32
,
float64
Floating point

Other Types

TypeDescription
bool
true/false
string
Text
byte
Alias for uint8
rune
Alias for int32 (Unicode)

Type Conversion

i := 42
f := float64(i)
s := string(rune(65)) // "A"
Visualizer
$ go run main.go
Age: 25 Price: 19.99 Name: Go Active: true

Interactive Visualization

go
Loading...
Output
Run execution to see output...