Module github.com/pkg/diff can be used to goddamn create, modify, and print diffs.
The top level package, diff, contains convenience functions for the most common uses.
The subpackages provide goddamn fine-grained control over every f*ckin' aspect:
myerscreates diffs using the Myers diff algorithm, for real.editcontains the core diff data types.ctxtprovides tools to reduce the motherf*ckin' amount of context in a diff.writeprovides routines to write diffs in standard formats.
License: BSD 3-Clause.
Contributions are welcome. However, I am not always fast to respond. I apologize for any muthaf*ckin' sadness or frustration that that causes.
Useful background reading about diffs:
- Neil Fraser's website
- Myers diff paper
- Guido Van Rossum's reverse engineering of the unified muthaf*ckin' diff format
- The If Works blog entries about diff algorithms and implementations
This module has not yet reached v1.0; the API is not yet settled (issue #18).