go 关键字/保留字
go 语言共有25个关键字
break | case | chan | const | continue |
default | defer | else | fallthrough | for |
func | go | goto | if | import |
interface | map | package | range | return |
select | struct | switch | type | var |
除了上面的关键字外, go语言还有36个保留字
append | bool | byte | cap | close | complex |
complex64 | complex128 | uint16 | copy | false | float32 |
float64 | imag | int | int8 | int16 | int32 |
int64 | uint | uint8 | true | uint32 | uint64 |
iota | len | make | new | nil | panic |
println | real | recover | string | uintptr |
注意事项:
- go语言关键字和保留字为系统预定义, 定义变量时不要使用