No description
Find a file
compliance-pr-automation-bot[bot] 909d4b01f8
[Compliance] - PR Template Changes Required (#5)
Co-authored-by: compliance-pr-automation[bot] <1425255+compliance-pr-automation-bot[bot]@users.noreply.github.com>
2025-12-17 17:50:08 +05:30
.github [Compliance] - PR Template Changes Required (#5) 2025-12-17 17:50:08 +05:30
cmd/go-diff Updating refs to go-diff 2025-12-12 13:27:05 -08:00
diff CORE-13673: typo 2023-04-21 20:44:18 +02:00
.travis.yml remove protobuf types (#51) 2020-09-04 18:27:41 +02:00
CODEOWNERS Add CODEOWNERS file for vault-scanning team 2025-12-12 17:09:14 -08:00
go.mod Updating refs to go-diff 2025-12-12 13:27:05 -08:00
go.sum CORE-4184: add ContentHandler interface 2023-04-12 12:35:08 -07:00
LICENSE include full license from python-unidiff 2023-01-22 21:17:19 +02:00
README.md update import path in README 2019-03-24 23:04:24 +01:00

go-diff Build Status GoDoc

Diff parser and printer for Go.

Installing

go get -u github.com/sourcegraph/go-diff/diff

Usage

It doesn't actually compute a diff. It only reads in (and prints out, given a Go struct representation) unified diff output, such as the following. The corresponding data structure in Go is the diff.FileDiff struct.

--- oldname	2009-10-11 15:12:20.000000000 -0700
+++ newname	2009-10-11 15:12:30.000000000 -0700
@@ -1,3 +1,9 @@ Section Header
+This is an important
+notice! It should
+therefore be located at
+the beginning of this
+document!
+
 This part of the
 document has stayed the
 same from version to
@@ -5,16 +11,10 @@
 be shown if it doesn't
 change.  Otherwise, that
 would not be helping to
-compress the size of the
-changes.
-
-This paragraph contains
-text that is outdated.
-It will be deleted in the
-near future.
+compress anything.