DiffText1 computes and returns the source text (all equalities and deletions).
(diffs []Diff)
| 1178 | |
| 1179 | // DiffText1 computes and returns the source text (all equalities and deletions). |
| 1180 | func (dmp *DiffMatchPatch) DiffText1(diffs []Diff) string { |
| 1181 | //StringBuilder text = new StringBuilder() |
| 1182 | var text bytes.Buffer |
| 1183 | |
| 1184 | for _, aDiff := range diffs { |
| 1185 | if aDiff.Type != DiffInsert { |
| 1186 | _, _ = text.WriteString(aDiff.Text) |
| 1187 | } |
| 1188 | } |
| 1189 | return text.String() |
| 1190 | } |
| 1191 | |
| 1192 | // DiffText2 computes and returns the destination text (all equalities and insertions). |
| 1193 | func (dmp *DiffMatchPatch) DiffText2(diffs []Diff) string { |