Golang 各种类型的默认值

前端之家收集整理的这篇文章主要介绍了Golang 各种类型的默认值前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Go的基本类型

  1. bool //默认值为false
  2. string //默认值为空字符串
  3. int int8 int16 int32 int64 //默认值为0
  4. uint uint8 uint16 uint32 uint64 uintptr //默认值为0
  5. byte // uint8 的别名
  6. rune // int32 的别名
  7. float32 float64 //默认值为0
  8. complex64 complex128 //默认值为0

猜你在找的Go相关文章