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

Used ContextKey type from go-ns, to prevent having incompatible types #8

Closed
wants to merge 1 commit into from

Conversation

DavidSubiros
Copy link
Contributor

@DavidSubiros DavidSubiros commented Aug 3, 2020

What

Use ContextKey type from go-ns, to prevent incompatible types in code that uses this library and other libraries that use the go-ns common ContextKey type. This is important because Context accepts interface{} type, so we would not be able to detect mismatches at compile time.

Although this PR looks like a step back, it is created in order to facilitate the transition from go-ns to dp-net. Once everything uses dp-net (and nothing refers to the go-ns ContextKey type directly), we can move the ContextKey type definition to this library, and everything will be consistent.

How to review

  • Make sure code change make sense. I tried to use this in dp-api-router, and checked that context values created by other libraries are correctly read now.
  • Unit tests should pass.

Who can review

Anyone.

…xt keys in services that use this library and other libraries which use go-ns ContextKey
@DavidSubiros
Copy link
Contributor Author

Closing - at the end we decided to update all libraries and services that depend on this (https://trello.com/c/SvDbv1J8/4814-safely-migrate-services-that-use-go-ns-context-key-to-dp-net)

@DavidSubiros DavidSubiros deleted the feature/use-context-key-from-gons branch August 6, 2020 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants