Go
- Propagate the existing request context through downstream work.
- Use
context.Background()only at process bootstrap or intentionally detached workers. - Prefer explicit code and constructor injection.
- Avoid package-level mutable state.
- Wrap errors with useful context. Never silently ignore them.
- Match existing project patterns before adding helpers.
- Add tests for new behaviour.
- Avoid dependencies unless the standard library or installed packages fall short.
Completion: changed Go code preserves request context, has explicit dependencies and useful errors, follows local package patterns, and passes the narrowest relevant tests.