Go Keywords
Let’s start looking at keywords, lists all the keywords inGo.
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 |
Keywords in Go.
We’ve seen some of these already. We used var
and const
in the section, and we briefly looked at package
and import
in our “Hello World”program at the start of the chapter. Others need more attention and have theirown chapter or section:
func
is used to declare functions and methods.return
is used to return from functions. We’ll look at bothfunc
andreturn
in detail in .go
is used for concurrency. We’ll look at this in .select
used to choose from different types of communication, We’ll work withselect
in .interface
is covered in .struct
is used for abstract data types. We’ll work withstruct
in .type
is also covered in .
当前内容版权归 Miek Gieben 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Miek Gieben .