Return errors to callers
MEDIUM1.0.2
When to apply When a Go function can fail.
Rule
Return errors to the caller instead of logging them and carrying on. Wrap each error with context using fmt.Errorf("doing x: %w", err).
Evidence
Every function that can fail returns an error, and callers handle it.