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
Since it is asserted in the tests (See screenshot of gnovm/pkg/gnofmt/processes_test.go), it looks like this extra line is added on purpose, but I wonder what's the reason of having this difference compared to go fmt.
So, actually go fmt makes sure that a newline exists at the end of the file. The picture of the test you sent asserts this (under the hood gnofmt/gnoimports is used to format the file).
But you are right, there is another newline being printed out ($ means newline, % means EOF):
This is due to a Println instead of a Printf inside the cmd itself while writing the file to disk.
After double-checking, this behavior only exists when printing on stdout (without the -w flag). It was intentional to have a space between files for distinction (gno fmt file_1.gno file_2.gno ... ), but upon second thought, it might be more coherent and intuitive to have the same behavior as go fmt and print out files without consideration of newlines between printed files.
Since it is asserted in the tests (See screenshot of
gnovm/pkg/gnofmt/processes_test.go
), it looks like this extra line is added on purpose, but I wonder what's the reason of having this difference compared togo fmt
.cc @gfanton
The text was updated successfully, but these errors were encountered: