go 支持的数据类型
标题Go语言内置以下这些基础类型:
- 布尔型 : bool
- 整形 : int , int8(byte) , int16 , int32 , int64,uint , uint8 , uint16 , uint32 , uint64
- 浮点型 : float , float32 , float64
- 复数 : complex64 , complex128
- 字符 : char
- 字符串 : string
- 字符类型 :rune
- 错误类型 : error
复合类型
- 指针(pointer)
- 数组(array)
- 切片(slice)
- 字典(map)
- 通道(chan)
- 结构体(struct)
- 接口(interface)
v:=1
fmt.printf("%T",V) //查看变量的基础数据类型