您的位置:首页 > 编程语言 > Go语言

Go语言中的25个关键字和30几个内置预声明的常量、类型和函数

2018-08-16 11:32 267 查看

Go有25个关键字,只能用在语法允许的地方,不能作为名称使用。

它们是:

break          default         func         interface         select

case           defer            go            map                struct

chan           else             goto         package          switch

const          fallthrough   if              range               type

continue     for               import      return               var      

内置的预声明的常量、类型和函数

常量:true    false    iota    nil

类型:int       int8      int16     int32     int64

           uint     uint8    uint16   uint32   uint64    uintptr

           float32   float64    complex128      complex64

           bool     byte     rune      string    error

函数: make    len    cap    new    append    copy    close    delete   

            complex     real    imag

            panic      recover

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐