Closed telemachus closed 2 years ago
While I'm here, I have a question. Would you consider a PR that implements diffing in Go using a library rather than with the Python script? (E.g., https://github.com/pmezard/go-difflib.)
I completely understand if you feel like golines
works and why mess with it, but I'm happy to work on it if you are open to the change. Either way, thanks for the tool.
@telemachus yes, that would be great. I actually used that library in a separate project that needed diff outputs (https://github.com/segmentio/kubeapply/blob/master/pkg/cluster/diff/diff.go#L177), and it worked well, but I never got around to updating things here.
The embedded python script currently adds color codes even if the user redirects output to a file (e.g.,
golines --dry-run file.go > diff.txt
).This updated version uses
isatty
to prevent that.