In this chapter, we mainly introduced the 25 Go keywords. Let's review what they are and what they do.
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
constare used to define variables and constants.
importare for package use.
funcis used to define functions and methods.
returnis used to return values in functions or methods.
deferis used to define defer functions.
gois used to start a new goroutine.
selectis used to switch over multiple channels for communication.
interfaceis used to define interfaces.
structis used to define special customized types.
defaultwere introduced in section 2.3.
chanis the type of channel for communication among goroutines.
typeis used to define customized types.
mapis used to define map which is similar to hash tables in other languages.
rangeis used for reading data from
If you understand how to use these 25 keywords, you've learned a lot of Go already.