Skip to content

Commit 81fbcbb

Browse files
committed
Update readme
1 parent 9f139ab commit 81fbcbb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ Common diff (Myers)
102102
go get github.com/peter-evans/patience
103103
```
104104

105+
## Usage
106+
107+
```go
108+
a := strings.Split(textA, "\n")
109+
b := strings.Split(textB, "\n")
110+
111+
diffs := patience.Diff(a, b)
112+
diff := patience.DiffText(diffs)
113+
```
114+
105115
## References
106116

107117
The patience diff algorithm is credited to Bram Cohen.

0 commit comments

Comments
 (0)