-
Notifications
You must be signed in to change notification settings - Fork 23
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
gohack undo leaves trailing newlines #68
Comments
There is a reason why the Go team doesn't provides a package to edit So |
Beware that Also, note that there is in fact a package to parse and print go.mod files: https://pkg.go.dev/golang.org/x/mod/modfile |
The fact is that you have to keep in sync the version of your Go toolchain with any other tools that have For
That isn't sustainable.
So |
This is how we can reproduce the issue:
git diff
produces:What I expected is that it there should be no diff, i.e.
Looking at the Go's source code
https://github.com/golang/go/blob/26154f31ad6c801d8bad5ef58df1e9263c6beec7/src/cmd/go/internal/modcmd/edit.go#L209
maybe we could include
modf.Cleanup()
beforemodf.Format()
ingohack/gomodcmd.go
Line 91 in 03d2ff3
Created PR #69 for this. 😄
The text was updated successfully, but these errors were encountered: