Skip to content

Glossary: Data Structures and Algorithms in Go

Comma-ok idiom

Also written: v, ok := m[key], ok flag

Go's way to report whether something worked without exceptions: a second `ok` result that is `false` when a map key is missing or a stack is empty.

Where the book teaches it

Related terms

Hash mapZero valuePush, pop, peek