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

transport: make http2Client.getStream() only return a stream. #2984

Merged
merged 1 commit into from
Aug 16, 2019

Conversation

easwars
Copy link
Contributor

@easwars easwars commented Aug 16, 2019

Suggested in #2980.

@easwars easwars requested a review from dfawley August 16, 2019 16:04
@dfawley dfawley changed the title transport: make http2Client.getStream() to only return a stream. transport: make http2Client.getStream() only return a stream. Aug 16, 2019
@easwars easwars merged commit c26cd97 into grpc:master Aug 16, 2019
@easwars easwars deleted the getstream branch August 16, 2019 18:55
@iwanbk
Copy link

iwanbk commented Aug 17, 2019

hi @dfawley @easwars,
as far as i can see, this change doesn't add any added value, the caller of getStream also doesn't get shorter. On the other hand:

Go's support for multiple return values provides a better solution. Instead of requiring clients to check for an in-band error value, a function should return an additional value to indicate whether its other return values are valid.
This prevents the caller from using the result incorrectly:
  • it becomes error-prone, as the caller might forget to do if err == nil check, which is not common things to do.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants