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

Use context consistently when it is part of a struct #513

Open
ChuntaoLu opened this issue Nov 1, 2018 · 0 comments
Open

Use context consistently when it is part of a struct #513

ChuntaoLu opened this issue Nov 1, 2018 · 0 comments
Assignees

Comments

@ChuntaoLu
Copy link
Contributor

Context is sometimes attached to request struct (e.g. https://github.com/uber/zanzibar/blob/master/runtime/tchannel_server.go#L202) and is supposed to be used as the context for the request, but context is still passed in as a paramter to the methods whose receiver is the request (i.e., the request already have access to the context). This makes it possible that a request method uses a different context from the one it holds, e.g. https://github.com/uber/zanzibar/blob/master/runtime/tchannel_server.go#L246-L249. For structs that hold context internally, context should not be an argument to its methods.

@ChuntaoLu ChuntaoLu self-assigned this Nov 1, 2018
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

No branches or pull requests

1 participant