Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify context #4706

Merged
merged 11 commits into from
Jul 16, 2019
11 changes: 11 additions & 0 deletions .pending/improvements/sdk/4706-Simplify-context
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
4706 - Simplify context

Replace complex Context construct with a simpler immutible struct.
Only breaking change is not to support `Value` and `GetValue` as first class calls.
We do embed ctx.Context() as a raw context.Context instead to be used as you see fit.

Migration guide:
`ctx = ctx.WithValue(contextKeyBadProposal, false)` ->
`ctx = ctx.WithContext(context.WithValue(ctx.Context(), contextKeyBadProposal, false))`
A bit more verbose, but also allows `context.WithTimeout()`, etc and only used
in one function in this repo, in test code.
Loading