How to
. A Practical Guide and Reference
Learn Go through annotated examples with plain explanations, code alongside the guides and tutorials, or solve one specific problem with the How to Go pages. They cover the same ground from different angles, so start with whichever one fits the way you learn.
$ go doc /
↑↓ move ↵ open esc clear 125 pages · 38 packages · 66 terms
Interactive
The algorithm pages run in the browser
Every algorithm page carries a diagram you drive yourself. This one is Dijkstra's, working out the shortest route from A to everywhere else.
- Settles the nearest unvisited node and shortens the routes leaving it.
- Keeps stepping until every node is settled.
- Puts every distance back to infinity.
The gopher stands on the node being settled. The number above each node is the shortest distance found so far, and the table under the graph is the same set of numbers in a row.
Read the Dijkstra page →Shortest distance from A
Press Step to settle the nearest unvisited node.
All Topics
The Language
- Hello, World
- Set up Environment
- Packages and Imports
- Types
- Variables
- Strings
- Runes
- Bytes
- Bitwise Operators
- Arrays
- Slices
- Maps
- Constants
- iota / Enums
- Functions
- Structs
- Methods / Receivers
- Interfaces
- Pointers
- Control Flow
- Loops
- If / Else
- Select
- Switch
- Generics
- Goto
- Concurrency
- Goroutines
- Channels
- Mutexes
- Atomic Operations
- Worker Pools
- Defer