On Mon, Oct 2, 2017 at 3:36 AM, William Josefsson <towilliamjosefs...@gmail.com> wrote: > > When I run $ go fmt main.go, I can see that the formatter adds an CR > '0a' character at the end. I verify this before and after with > hexdump. My editor also can detect the trailing line. Somewhat > confusing. > > Is this expected? I tried to search for this but couldn't find any > reason to what may cause this. Pls advice. Thank you, will
You confused me for a minute. 0xa is not CR, it is LF. gofmt does add a trailing newline to a file if the last line ends without an end-of-line character. That is normal behavior for Unix systems. Are you running Windows? Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.