We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d44dcdb commit 367a9e1Copy full SHA for 367a9e1
diff.go
@@ -13,6 +13,15 @@ type Data interface {
13
Equal(i, j int) bool
14
}
15
16
+// Strings returns the differences of two strings.
17
+func Strings(a, b string) []Change {
18
+ return Diff(len(a), len(b), &strings{a, b})
19
+}
20
+
21
+type strings struct{ a, b string }
22
23
+func (d *strings) Equal(i, j int) bool { return d.a[i] == d.b[j] }
24
25
// Bytes returns the difference of two byte slices
26
func Bytes(a, b []byte) []Change {
27
return Diff(len(a), len(b), &bytes{a, b})
0 commit comments