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
{{ message }}
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.
I like the package very much. It is only that there is this one very annoying detail that all go files that are formatted using this package end up having an empty line at the end of the file. This should be fixed IMO. As you can see in the screenshot I made from the developer console, the property r.stdout holds the formatted source code having the trailing newline attached. The beginning of the formatted source code string is correct, the end is not.
This is how it should look like. Note the difference of the end of the code.
"package main
import "fmt"
func main() {
fmt.Printf("%#vn", "foo")
}"
Also note that I am using goimports, but gofmt is doing the same. In fact, it is not the go tools that produce this, but the OS command execution and stdout capturing itself. I think a simple check for a newline at the end and removing it in case it is there should be good enough. This is the result now.
The text was updated successfully, but these errors were encountered:
I like the package very much. It is only that there is this one very annoying detail that all go files that are formatted using this package end up having an empty line at the end of the file. This should be fixed IMO. As you can see in the screenshot I made from the developer console, the property
r.stdout
holds the formatted source code having the trailing newline attached. The beginning of the formatted source code string is correct, the end is not.This is how it should look like. Note the difference of the end of the code.
Also note that I am using
goimports
, butgofmt
is doing the same. In fact, it is not the go tools that produce this, but the OS command execution and stdout capturing itself. I think a simple check for a newline at the end and removing it in case it is there should be good enough. This is the result now.The text was updated successfully, but these errors were encountered: