As we have seen in the 'Data Types' topic, there are three types of Numbers supported by Go. Integers, floating point numbers and complexs numbers.
package main import "fmt" func main() { var x int = 5 fmt.Println(x) }
package main import "fmt" func main() { var x uint8 = 35 fmt.Println(x) }
package main import "fmt" func main() { var x uint8 = 456 fmt.Println(x) }
package main import "fmt" func main() { var x uint16 = 54364 fmt.Println(x) }
package main import "fmt" func main() { var x uint32 = 645738765 fmt.Println(x) }
package main import "fmt" func main() { var x uint64 = 8765432876509876567 fmt.Println(x) }
package main import "fmt" func main() { var x int8 = -125 fmt.Println(x) }
package main import "fmt" func main() { var x int16 = -24364 fmt.Println(x) }
package main import "fmt" func main() { var x int32 = -243435664 fmt.Println(x) }
package main import "fmt" func main() { var x int64 = -223372036854775808 fmt.Println(x) }
package main import "fmt" func main() { var x float32 = 5.987 fmt.Println(x) }
package main import "fmt" func main() { var x float64 = 5.9875532556 fmt.Println(x) }
package main import "fmt" func main() { var x complex64 = complex(2, 5) fmt.Println(x) }
package main import "fmt" func main() { var x complex128 = complex(6, 8) fmt.Println(x) }