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
I've just tried using golines for the first time and can't get it to make any changes at all. This has lists a file to change but does not change it:
go get -tool github.com/segmentio/golines@latest
go tool golines -w -l .
I can keep re-running golines -w -l . and every time it reports the same file but makes no changes.
Nothing I can do seems to make it actually write a file.
As a temporary work around I tried t run golines --dry-run . | patch But then ...
Related or Unrelated?
Not sure if these are both the same issue or unrelated issues. I'm happy to raise a second issue if you think they are unrelated
I can get the changes golines was trying to make with:
go tool golines --dry-run .
I had hoped to simply apply this output as a patch but there's a catch: I immediately get an error from patch:
patch: **** malformed patch at line 14: @@ -34,7 +37,10 @@
The root cause of this is that the --dry-run output is somehow generating an incorrect patch and the block sizes are incorrect. This causes patch to read the next block header as content of the previous block and get confused.
The number after the comma is supposed to be the number of lines contained in the patch file.
So the example line @@ -34,7 +37,10 @@ tells patch to expect:
I've just tried using golines for the first time and can't get it to make any changes at all. This has lists a file to change but does not change it:
go get -tool github.com/segmentio/golines@latest go tool golines -w -l .
I can keep re-running
golines -w -l .
and every time it reports the same file but makes no changes.Nothing I can do seems to make it actually write a file.
As a temporary work around I tried t run
golines --dry-run . | patch
But then ...Related or Unrelated?
Not sure if these are both the same issue or unrelated issues. I'm happy to raise a second issue if you think they are unrelated
I can get the changes
golines
was trying to make with:go tool golines --dry-run .
I had hoped to simply apply this output as a patch but there's a catch: I immediately get an error from
patch
:The root cause of this is that the
--dry-run
output is somehow generating an incorrect patch and the block sizes are incorrect. This causespatch
to read the next block header as content of the previous block and get confused.The number after the comma is supposed to be the number of lines contained in the patch file.
So the example line
@@ -34,7 +37,10 @@
tells patch to expect:-
plus context lines.+
plus context lines.example.go
Generated diff with
golines --dry-run example.go
The patch should have been this:
The text was updated successfully, but these errors were encountered: