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

cmd/go: Internal comment refers to no longer existing parameter. #15503

Closed
dmitshur opened this issue May 1, 2016 · 3 comments
Closed

cmd/go: Internal comment refers to no longer existing parameter. #15503

dmitshur opened this issue May 1, 2016 · 3 comments
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented May 1, 2016

In src/cmd/go/build.go:2176, the comment says:

// The compiler runs in the directory dir.

However, there is no longer a parameter to gc called dir. I dug git blame, and found that it was removed in:

604f375

FWIW, it was added in b03a5f6.

I would fix it myself, but I'm not most familiar with this code (in fact, I'm trying to learn/understand it right now, and this invalid comment made it harder). Removing the comment might work, but maybe it's better to refer to the obj parameter instead? Someone more familiar with this can resolve it easily, I just wanted to point out the invalid comment. (I would've left a comment on CL, but it's so old that it's on Rietveld, not sure anyone would see it.)

@dmitshur
Copy link
Contributor Author

dmitshur commented May 1, 2016

Actually, removing the comment might most appropriate. It has nothing to do with obj. The compiler isn't run in a specific dir anymore (as far as I can tell).

@griesemer griesemer added this to the Go1.7 milestone May 1, 2016
@rsc rsc removed their assignment May 17, 2016
@rsc rsc modified the milestones: Go1.8, Go1.7 May 17, 2016
@dmitshur
Copy link
Contributor Author

dmitshur commented Jun 10, 2016

I've familiarized myself more with the history of what happened and this code, and I am now pretty confident that the comment should simply be removed.

It was introduced alongside with a change that added a parameter dir. That parameter was later removed, but the comment remained. So now it refers to a parameter that doesn't exist, which is confusing.

Simply removing it will resolve this issue.

@gopherbot
Copy link

CL https://golang.org/cl/24011 mentions this issue.

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

No branches or pull requests

4 participants