Skip to content

sourcegraph/go-diff-patch

Repository files navigation

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.

About

Go library for generating "git-compatible" patches

Resources

License

Stars

Watchers

Forks

Contributors 404

Languages