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

net/dial.go local variable d conflicted with receiver d #40361

Closed
edocevol opened this issue Jul 23, 2020 · 3 comments
Closed

net/dial.go local variable d conflicted with receiver d #40361

edocevol opened this issue Jul 23, 2020 · 3 comments

Comments

@edocevol
Copy link

edocevol commented Jul 23, 2020

Does this issue reproduce with the latest release?

Yes

What did you do?

change d, ok := ctx.Deadline() to dl, ok := ctx.Deadline()

What did you expect to see?

if dl, ok := ctx.Deadline(); ok {
	earliest = minNonzeroTime(earliest, dl)
}

What did you see instead?

if d, ok := ctx.Deadline(); ok {
	earliest = minNonzeroTime(earliest, d)
}
@davecheney
Copy link
Contributor

This is ok according to the scoping rules in Go, the d in the scope of the if shadows another declaration in the outer scope. If you feel strongly that this should be changed, please consider deadline.

@davecheney davecheney changed the title proposal net/dial.go local variable d conflicted with receiver d net/dial.go local variable d conflicted with receiver d Jul 23, 2020
@davecheney
Copy link
Contributor

removed the proposal title element, this is not a proposal according to the definition.

@mdlayher
Copy link
Member

The author submitted and subsequently closed a pull request with no further comment, so I assume there is nothing to be done here. Closing.

@golang golang locked and limited conversation to collaborators Jul 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants