Merge pull request #80 from josharian/opstringer

Make Operation a stringer
diff --git a/diffmatchpatch/diff.go b/diffmatchpatch/diff.go
index 0d7abd8..0d1c2d4 100644
--- a/diffmatchpatch/diff.go
+++ b/diffmatchpatch/diff.go
@@ -25,6 +25,8 @@
 // Operation defines the operation of a diff item.
 type Operation int8
 
+//go:generate stringer -type=Operation -trimprefix=Diff
+
 const (
 	// DiffDelete item represents a delete diff.
 	DiffDelete Operation = -1
diff --git a/diffmatchpatch/operation_string.go b/diffmatchpatch/operation_string.go
new file mode 100644
index 0000000..533ec0d
--- /dev/null
+++ b/diffmatchpatch/operation_string.go
@@ -0,0 +1,17 @@
+// Code generated by "stringer -type=Operation -trimprefix=Diff"; DO NOT EDIT.
+
+package diffmatchpatch
+
+import "fmt"
+
+const _Operation_name = "DeleteEqualInsert"
+
+var _Operation_index = [...]uint8{0, 6, 11, 17}
+
+func (i Operation) String() string {
+	i -= -1
+	if i < 0 || i >= Operation(len(_Operation_index)-1) {
+		return fmt.Sprintf("Operation(%d)", i+-1)
+	}
+	return _Operation_name[_Operation_index[i]:_Operation_index[i+1]]
+}