Skip to content
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

Find an alternative for go-difflib #1159

Open
tbankar opened this issue Feb 22, 2022 · 7 comments
Open

Find an alternative for go-difflib #1159

tbankar opened this issue Feb 22, 2022 · 7 comments

Comments

@tbankar
Copy link

tbankar commented Feb 22, 2022

As github.com/pmezard/go-difflib is no longer maintained (EOLed), kindly find an alternative.

@MaxCaresYww
Copy link

Indeed, can this be prioritized?

@dolmen
Copy link
Collaborator

dolmen commented Jul 25, 2023

@MaxCaresYww What replacement do you suggest?

@bmv126
Copy link

bmv126 commented Nov 12, 2023

@dolmen
Can we replace with https://github.com/martinohmann/go-difflib ?

@dolmen
Copy link
Collaborator

dolmen commented Nov 13, 2023

Any replacement suggestion must at least say why this would be a good candidate.

@tscales
Copy link
Contributor

tscales commented Nov 17, 2023

#1479 mentioned using go-diff which has seen adoption in popular libraries like go-git.

However, go-diff seems not very well maintained itself in recent years and the introduction of bugs has had some people sticking with v.1.1.0 until only very recently.

@brackendawson
Copy link
Collaborator

github.com/martinohmann/go-difflib looks to be no more maintained than github.com/pmezard/go-difflib in any practical sense.

There's no current known vulnerabilities or breaking issues in go-difflib. If there were then we would promptly replace it, possibly with a maintained fork or possibly with something else. I'd throw https://github.com/google/go-cmp into the ring as it's diff output appears to make use of non-breaking whitespace to keep the diff displaying cleanly.

For now I don't anticipate it being replaced in testify. Some orgs (including the one I work for) impose a rule on themselves to not use any unsupported packages. But testify is (should) not be being compiled into any binaries they produce. I've not seen this be a hard stop for anyone yet.

@eero-t
Copy link

eero-t commented Feb 17, 2025

According to #736, only 2 functions for go-difflib would need to be copied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants