Canonical guidance

Use when

Avoid

Preferred pattern

v, ok := m[key]
if !ok {
	return
}
_ = v

Anti-pattern

Explanation: This is tempting when plumbing code quickly, but ignored errors erase the branch that tells the program what actually happened.

Why

Related pages

Sources