Keywords
| Keyword | Description |
|---|---|
| break | Leaves a loop or switch statement early. |
| default | Specifies code to run in a switch statement when none of the cases match the condition. |
| func | Indicates the start of a function declaration. |
| interface | Declares a set of methods that a type must implement to satisfy the interface. |
| select | Used to choose between different channels for communication. |
| case | One of the possible options in a switch statement. |
| defer | Delays the execution of a function until the surrounding function returns. |
| go | Launches a new goroutine, which is a lightweight thread of execution. |
| map | A built-in type that associates values with keys. |
| struct | Defines a collection of fields that belong together. |
| chan | A channel type used for inter-goroutine communication. |
| else | Executes code if the if statement condition is false. |
| goto | Jumps to a labeled statement in the same function. |
| package | Declares the name of the package that the file belongs to. |
| switch | Evaluates an expression and chooses a case to execute based on its value. |
| const | Defines a constant value that cannot be changed. |
| fallthrough | Forces execution into the next case in a switch statement (use sparingly). |
| if | Begins an if statement for conditional execution. |
| range | Iterates over elements in an array, slice, string, map, or channel. |
| type | Declares a new type, possibly based on an existing type. |
| continue | Skips the current iteration of a loop and moves to the next one. |
| for | Begins a loop or range statement for repetitive execution. |
| import | Imports packages from other modules. |
| return | Exits the function and returns a value to the caller. |
| var | Declares a variable with an optional initial value. |
don't study this list too much right now. It might be a good reference for later.