aboutsummaryrefslogtreecommitdiff
path: root/diff/lines
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-06 11:17:28 +0800
committerGravatar Runxi Yu2026-03-06 11:17:28 +0800
commit5da80869bce6a40584de32d8c18e10411b93db63 (patch)
tree2c3bdcdff1ae5d7c653dc536c02c0e5241bf3529 /diff/lines
parentformat/pack/ingest: Split files (diff)
signatureNo signature
diff/lines: Split files
Diffstat (limited to 'diff/lines')
-rw-r--r--diff/lines/chunk.go20
-rw-r--r--diff/lines/diff.go19
2 files changed, 20 insertions, 19 deletions
diff --git a/diff/lines/chunk.go b/diff/lines/chunk.go
new file mode 100644
index 00000000..b5856d29
--- /dev/null
+++ b/diff/lines/chunk.go
@@ -0,0 +1,20 @@
+package lines
+
+// Chunk represents a contiguous region of lines categorized
+// as unchanged, deleted, or added.
+type Chunk struct {
+ Kind ChunkKind
+ Data []byte
+}
+
+// ChunkKind enumerates the type of diff chunk.
+type ChunkKind int
+
+const (
+ // ChunkKindUnchanged represents an unchanged diff chunk.
+ ChunkKindUnchanged ChunkKind = iota
+ // ChunkKindDeleted represents a deleted diff chunk.
+ ChunkKindDeleted
+ // ChunkKindAdded represents an added diff chunk.
+ ChunkKindAdded
+)
diff --git a/diff/lines/diff.go b/diff/lines/diff.go
index ca34f371..6f958923 100644
--- a/diff/lines/diff.go
+++ b/diff/lines/diff.go
@@ -229,22 +229,3 @@ func Diff(oldB, newB []byte) ([]Chunk, error) { //nolint:maintidx
return out, nil
}
-
-// Chunk represents a contiguous region of lines categorized
-// as unchanged, deleted, or added.
-type Chunk struct {
- Kind ChunkKind
- Data []byte
-}
-
-// ChunkKind enumerates the type of diff chunk.
-type ChunkKind int
-
-const (
- // ChunkKindUnchanged represents an unchanged diff chunk.
- ChunkKindUnchanged ChunkKind = iota
- // ChunkKindDeleted represents a deleted diff chunk.
- ChunkKindDeleted
- // ChunkKindAdded represents an added diff chunk.
- ChunkKindAdded
-)