Skip to content
This repository was archived by the owner on Apr 29, 2026. It is now read-only.

Latest commit

 

History

History
20 lines (12 loc) · 1.09 KB

README.md

File metadata and controls

20 lines (12 loc) · 1.09 KB

go-diff-patch

Go CI lsif-go

A fork of Go tools. Go-diff-patch is an utility library that is used to generate git-compatible patches that are appliable to any repository.

Installation

go-diff-patch can be installed using the go get command as shown below:

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

Usage

The library exports a function GeneratePatch which computes edits between the original and updated file contents and produces a unified diff for them as a string. This patch can then be applied to a valid git repository containing the specified file(s).

An example can be found in the examples/ directory.