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 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

@davecheney davecheney commented Jul 23, 2020

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

@davecheney davecheney commented Jul 23, 2020

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

@mdlayher
Copy link
Member

@mdlayher mdlayher commented Jul 23, 2020

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

@mdlayher mdlayher closed this Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.