Categorygithub.com/sourcegraph/go-diff-patch
modulepackage
0.0.0-20240223163233-798fd1e94a8e
Repository: https://github.com/sourcegraph/go-diff-patch.git
Documentation: pkg.go.dev

# README

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.

# Packages

No description provided by the author

# Functions

GeneratePatch generates a unified diff that is git-compatible and highlights the difference between originalContent and updatedContent.