工作生活

go的保留字以及关键字

2019-06-30  本文已影响0人  魔法时刻

在Go中,为了简化代码编译过程中对代码的解析,其定义的保留关键字只有25个。详见如下:

1 2 3 4 5
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

除了保留关键字外,外另还提供了36个预定的标识符,其包括基础数据类型和系统内嵌函数。

1 2 3 4 5 6
append bool byte cap close complex
complex64 complex128 uint16 copy false float32
float64 imag int int8 int16 uint32
int32 int64 iota len make new
nil panic uint64 print println real
recover string true uint uint8 uintp
上一篇 下一篇

猜你喜欢

热点阅读