基本类型

类型初始化

//"const" 用于常量,
//"var" 或 ':=' 用于变量

//整数
number, otherNumber := 42, 37
const maxInt64 = math.MaxInt64
const Mb = 1048576

//双精度浮点数
const exp = 2.71828
var billion = 1E+9

//单精度浮点数
const pi = 3.14

//字符串
const greeting = "Hello"

//多行字符串
var text = `this is some
multiline text`

//布尔值
const sunIsStar = true
var earthIsStar = false

//字符 "A"
const charA = 'A' //'\x41'

fmt.Println("number =", number)
fmt.Println("otherNumber =", otherNumber)