Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 677 Bytes

1.md

File metadata and controls

25 lines (21 loc) · 677 Bytes

第03章 数据类型

1.1 基本数据类型

  • bool
  • string
  • int,int8,int16,int32,int64
  • uint,uint8,uint16,uint32,uint64,uintptr
  • byte//alias for uint8
  • rune//alias for int32,represents a Unicode code point
  • float32,float64,
  • complex64,complex128

1.2 类型转化

  • Go 语言不允许隐式类型转换
  • 别名和原有类型也不能进行隐式类型转换

1.3 类型的预定于值

  • math.MaxInt64
  • math.MaxFloat64
  • math.MaxUint32

1.4 指针类型

与其他主要编程语言的差异

  • 不支持指针运算
  • string是值类型,其默认的初始化值为空字符串,而不是nil