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

go/build: matchFile parameter returnImports is actually unused #19474

Closed
mvdan opened this issue Mar 9, 2017 · 2 comments
Closed

go/build: matchFile parameter returnImports is actually unused #19474

mvdan opened this issue Mar 9, 2017 · 2 comments
Milestone

Comments

@mvdan
Copy link
Member

mvdan commented Mar 9, 2017

And has been ever since it was introduced in 2013 by @rsc. The godoc says:

// If returnImports is true and name denotes a Go program, matchFile reads
// until the end of the imports (and returns that data) even though it only
// considers text until the first non-comment.

Should the method actually use the bool parameter, or should it be removed from the signature and godoc? The func is currently called called with both true and false.

Found by https://github.com/mvdan/unparam.

@rsc
Copy link
Contributor

rsc commented Mar 17, 2017

You can delete the parameter. The code uses the file suffix instead, which is a better source of truth.

@gopherbot
Copy link

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

@bradfitz bradfitz added this to the Go1.9 milestone Mar 21, 2017
@golang golang locked and limited conversation to collaborators Mar 21, 2018
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