https://github.com/carvel-dev/difflib
Used by get-kapp.io
https://github.com/carvel-dev/difflib
Last synced: 6 months ago
JSON representation
Used by get-kapp.io
- Host: GitHub
- URL: https://github.com/carvel-dev/difflib
- Owner: carvel-dev
- License: mit
- Fork: true (aryann/difflib)
- Created: 2020-01-08T17:12:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-18T05:50:34.000Z (over 2 years ago)
- Last Synced: 2025-11-07T10:22:07.857Z (8 months ago)
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[](http://godoc.org/github.com/aryann/difflib)
difflib
=======
difflib is a simple library written in [Go](http://golang.org/) for
diffing two sequences of text.
Installing
----------
To install, issue:
go get github.com/aryann/difflib
Using
-----
To start using difflib, create a new file in your workspace and import
difflib:
import (
...
"fmt"
"github.com/aryann/difflib"
...
)
Then call either `difflib.Diff` or `difflib.HTMLDiff`:
fmt.Println(difflib.HTMLDiff([]string{"one", "two", "three"}, []string{"two", "four", "three"}))
If you'd like more control over the output, see how the function
`HTMLDiff` relies on `Diff` in difflib.go.
Running the Demo
----------------
There is a demo application in the difflib_demo directory. To run it,
navigate to your `$GOPATH` and run:
go run src/github.com/aryann/difflib/difflib_server/difflib_demo.go
Where `` and `` are two text files you'd like to
diff. The demo will launch a web server that will contain a table of
the diff results.