Canonical guidance

Use when

Avoid

Preferred pattern

if err != nil {
	return fmt.Errorf("load config: %w", err)
}

Anti-pattern

Explanation: This is tempting because the concrete pointer is nil, but once stored in an interface the dynamic type is still present.

Why

Related pages

Sources