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/dist: accept imports with leading space #47544
Comments
Change https://golang.org/cl/340030 mentions this issue: |
Go 1.11 is not a supported version, does this reproduce on the latest release? |
Yes, the code that have bug is following: Line 291 in 6e73886
|
The go code should be formatted with |
cmd/dist is only used to build the Go standard library and tools. It's OK for cmd/dist to assume that all the input files have gone through gofmt. In fact, it's a good thing if cmd/dist fails if the files have not gone through gofmt. So I don't think we should change this. |
IMO, code style and correct code might be different things. I usually develop Go code firstly and then modify the format with |
You can think of this as a coding style error in Go. Just like
can't be
This just shows that this check works. |
Sure. But our rule for the standard library and tools is simple: all files must be formatted using gofmt. No exceptions.
Thanks, but I don't find any of these arguments to be convincing. If cmd/dist supports files that are not formatted with gofmt, then it will be easier to accidentally submit such files to the repo. We don't want that to happen, so let's not change cmd/dist. Yes, this may requires using |
@ianlancetaylor I got it. Thank you for answering my questions patiently. I will abandon the CL. |
Thanks. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I import packages and indent with spaces, just like this:
What did you expect to see?
When I import packages and indent with spaces, I can execute make.bash successfully.
Just keep consistent with the behavior of the go compiler.
Thanks!
What did you see instead?
The text was updated successfully, but these errors were encountered: