Created
February 28, 2020 15:23
-
-
Save pior/e0d1222c3af0c33e5f8cf340b6dfef5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func BackgroundWithValues(contextForValues context.Context) context.Context { | |
return cancellationBlockerContext{context.Background(), contextForValues} | |
} | |
type cancellationBlockerContext struct { | |
context.Context | |
valueCtx context.Context | |
} | |
func (c *valuesContext) Value(key interface{}) interface{} { | |
return c.valueCtx.Value(key) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment