Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 19-Nov-2020 | - | ||||
LICENSE | H A D | 19-Nov-2020 | 1 KiB | 8 | 4 | |
README.md | H A D | 19-Nov-2020 | 1.1 KiB | 50 | 31 | |
difflib.go | H A D | 19-Nov-2020 | 5.6 KiB | 191 | 122 |
README.md
1[![GoDoc](https://godoc.org/github.com/aryann/difflib?status.svg)](http://godoc.org/github.com/aryann/difflib) 2 3difflib 4======= 5 6difflib is a simple library written in [Go](http://golang.org/) for 7diffing two sequences of text. 8 9 10Installing 11---------- 12 13To install, issue: 14 15 go get github.com/aryann/difflib 16 17 18Using 19----- 20 21To start using difflib, create a new file in your workspace and import 22difflib: 23 24 import ( 25 ... 26 "fmt" 27 "github.com/aryann/difflib" 28 ... 29 ) 30 31Then call either `difflib.Diff` or `difflib.HTMLDiff`: 32 33 fmt.Println(difflib.HTMLDiff([]string{"one", "two", "three"}, []string{"two", "four", "three"})) 34 35If you'd like more control over the output, see how the function 36`HTMLDiff` relies on `Diff` in difflib.go. 37 38 39Running the Demo 40---------------- 41 42There is a demo application in the difflib_demo directory. To run it, 43navigate to your `$GOPATH` and run: 44 45 go run src/github.com/aryann/difflib/difflib_server/difflib_demo.go <file-1> <file-2> 46 47Where `<file-1>` and `<file-2>` are two text files you'd like to 48diff. The demo will launch a web server that will contain a table of 49the diff results. 50