Skip to content

Return (response, error) #4#1729

Merged
tamird merged 2 commits intocockroachdb:masterfrom
tamird:return-replies-4
Jul 19, 2015
Merged

Return (response, error) #4#1729
tamird merged 2 commits intocockroachdb:masterfrom
tamird:return-replies-4

Conversation

@tamird
Copy link
Copy Markdown
Contributor

@tamird tamird commented Jul 18, 2015

Working on this PR I discovered that shadowing err is a serious footgun, so I'm going to suggest that we tighten up our linters to prevent that. I've started working on that already, and it results in some annoying contortions, but the sad reality is that shadowing err is quite a dangerous pattern.

Anyway, the next PR in this series will require changing Sender, so I expect it'll be bigger than the past few have been. Apologies in advance.

@tbg tbg added the PTAL label Jul 18, 2015
@tamird tamird mentioned this pull request Jul 19, 2015
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you used := here, go vet (without --shadow) should give a warning about err declared but not used.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, maybe this wasn't what you were pointing to?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bdarnell
Copy link
Copy Markdown
Contributor

LGTM

tamird added a commit that referenced this pull request Jul 19, 2015
@tamird tamird merged commit 7704898 into cockroachdb:master Jul 19, 2015
@tamird tamird deleted the return-replies-4 branch July 19, 2015 19:25
@tbg tbg removed the PTAL label Jul 19, 2015
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.

4 participants