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/scanner: rewrite \r\n to \n in comments #3961
Labels
Milestone
Comments
Labels changed: added priority-later, removed priority-triage. Owner changed to @griesemer. Status changed to Accepted. |
The previous issue about this was issue #680. We decided that \r is ignored so that \r\n becomes \n in multiline `` literals. So this seems like just an update to go/scanner to do the same in comments. |
I cannot reproduce this: Try e.g.: http://play.golang.org/p/qNfUiJ5lGf which takes your example, introduces the \r\n's and then invokes gofmt on it. The \r\n's are gone afterwards. (You need to copy playground source into a local file, say test.go, and run it with: "go run test.go" because the gofmt executable is not available in the playground. Make sure gofmt is in your $PATH). Similarly, when storing the source as a file with \r\n line endings (crlf.go) and applying both gofmt or go fmt, the \r\n's are gone and replaced by \n's everywhere. Finally, go/scanner is testing explicitly that the \r's are gone. Perhaps your favorite editor is doing something funny? I am going to close this. If you have a concrete test case that misbehaves (executable source - no manual steps that rely on some 3rd party editor), than you can reopen this. Thanks. Status changed to WorkingAsIntended. |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
by accipiter:
The text was updated successfully, but these errors were encountered: