Skip to content

Commit

Permalink
Add diffing library
Browse files Browse the repository at this point in the history
  • Loading branch information
mkchoi212 committed Dec 29, 2017
1 parent 84cfcee commit 4faa632
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions diff.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"fmt"
"strings"

"github.com/sergi/go-diff/diffmatchpatch"
)

func (c *Conflict) Diff() {
dmp := diffmatchpatch.New()
diffs := dmp.DiffMain(strings.Join(c.CurrentLines, "\n"), strings.Join(c.ForeignLines, "\n"), false)
fmt.Println(dmp.DiffPrettyText(diffs))
}

0 comments on commit 4faa632

Please sign in to comment.