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

assert: switch the diff library to go-diff #1546

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mitioshi
Copy link

Summary

This PR changes the diff library used in the assert package to go-diff.

Changes

the library used for diffing was replaced to go-diff/diffmatchpatch which is actively maintained and enables us to access structured diffs.

Motivation

See the parent PR for more context

difflib is no longer maintained and cannot be extended to modify the diff structure. We end up outputting whatever the library spews without being able to modify it easily. Having the access to the diff structure gives us a more fine-grained control over what we show to users.
The initial motivation for this PR was to add colorized diffs to assert.Equal. Accessing the diff structure would make this task trivial

Related issues

Split from #1480 as per @dolmen's suggestion

@mitioshi mitioshi force-pushed the switch-diff-library-to-go-diff branch from 31ad2a7 to bc848ba Compare February 22, 2024 07:09
@dolmen dolmen added the dependencies Pull requests that update a dependency file label Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants