Go Keywords

Let’s start looking at keywords, lists all the keywords inGo.

breakdefaultfuncinterfaceselect
casedefergomapstruct
chanelsegotopackageswitch
constfallthroughifrangetype
continueforimportreturnvar

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 both func and return 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 with select in .
  • interface is covered in .
  • struct is used for abstract data types. We’ll work with struct in .
  • type is also covered in .