go语言学习(基本数据类型)

值类型:

int/uint :根据系统确定是32还是64位。此外还有int8/uint8、int16/uint16、int32/uint32、int64/uint64

byte:字节型,相当于uint8。

float:go语言中没有double型,因为已经有了float32/float64,分别精确到小数点后面7、15位。

uintptr:保存32bit或64bit指针,应该是保存指针的地址

其他值类型:

array

string

struct

引用类型:

slice

map

chan

接口类型

interface

函数类型

func:函数也是一种类型,因为go语言的函数可以赋值给变量。

猜你喜欢

转载自www.cnblogs.com/howo/p/9033807.html