-
Examples used in the following article Konstrukce pro řízení běhu programu v jazyce Go
-
This article is part of the serie about Go programming language Programovací jazyk Go
- Main function only
- Return statement
- Code after return statement
- Code after return statement
- Code after return statement
- Simple if statement
- Bad type of expression in if statement (numerical)
- Bad type of expression in if statement (nil)
- if-else construct
- if-else bad syntax
- Return statement in if construct
- Local variable from if not visible outside
- switch statement
- Constants in switch statement
- Variables in switch statement
- Conditions in switch statement
- No fallthrough keyword in case branches
- Usage of fallthrough keyword in case branches
- Various combinations of switch statement
- Switch on string values
- Simplest form of for loop
- Basic for loop
- For loop with condition
- C-like for loop
- Better variant, local variable
- Loop variable is really local
- For-range loop style
- Unused index variable
- Placeholder instead of index variable
- Iterating over map
- Break statement
- Continue statement
- Nested loop
- Break statement to end inner loop
- Continue statement to skip one iteration in inner loop