You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. edit windows go src and use \r\n line terminator.
//test comment,test.go
package main
func main() {
}
The file include \r\n line terminator.
//test comment,test.go[\r\n]
[\r\n]
package main[\r\n]
[\r\n]
func main() {[\r\n]
}[\r\n]
2. gofmt -w test.go
3. the output test.go comment include [\r\n]
What is the expected output?
//test comment,test.go[\r\n]
package main[\n]
...
What do you see instead?
//test comment,test.go[\n]
package main[\n]
...
Which operating system are you using?
Windows7
Which version are you using? (run 'go version')
go1.01
Please provide any additional information below.
The gofmt not convert source comment \r\n to \n
The text was updated successfully, but these errors were encountered:
I can confirm this behavior: I created a file with \r at end of lines:
package p\r
\r
// hello world\r
and when you run through gofmt you get
package p
// hello world\r
The \r stripping should probably apply during comments too.
by VisualFC:
The text was updated successfully, but these errors were encountered: