Golang变量的数据类型

1.基本数据类型

  1.1 数值型

    1.1.1 整数类型

      int、int8、int16、int32

      uint、uint8、uint16、uint32、uint64、byte

   1.1.2 浮点类型

      float32、float64

  1.2字符型

  没有专门的字符型,使用byte,来保存单个字母字符

  1.3布尔型

    bool

  1.4字符串

    string

2.派生/复杂数据类型

  2.1 指针

    pointer

  2.2 数组

  2.3 结构体

    struct

  2.4 管道

    channel

  2.5 函数

  2.6切片

    slice

  2.7接口

    interface

2.8map

posted @ 2021-04-28 07:30  创客未来  阅读(87)  评论(0编辑  收藏  举报