EN

25 Keywords in Go

Go supports only 25 keywords. It's very simple, which has the advantage of a low learning curve. I've never posting it while using Go. Let me summarize the meaning of each keyword today.

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

https://golang.org/ref/spec#Keywords

GroupKeywordDescription
Declarationconstscalar value
varvariables
funcfunction
typenew struct type
importimport package
packagegrouped as unit in a package
Composite typeschango channel
interfaceUsed to specify a method set
mapdefine map type
structcollection of fields
Control flowbreakterminate a loop
caseform of a switch construct
continuego back to the beginning of for loop
defaultdefault case in switch
elsefalse processing in if
fallthroughnext case in switch statement
forloop
gotojump to labeled statement
ifused a check certain condition
rangeiterate items over the list items like map
returnreturn
selectgoroutine to wait during the simultaneous communication operations
switchused to start a loop and use the if-elf logic with in block
Funcion modifierdeferused to defer the execution of a function. runs when leave the code block.
gorun goroutine