Help us shape the future of Go! Take the 2026 Go Developer Survey

diff

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Patch

func Patch(text1, text2 string, checklines bool) []diffmatchpatch.Patch

Patch Compare two strings and return the array of differences

func PatchApply

func PatchApply(text string, patch []diffmatchpatch.Patch) (string, []bool)

PatchApply Apply a patch to a text

func PatchApplyString

func PatchApplyString(text string, patch string) (string, []bool, error)

PatchApplyString Apply a text formatted patch to a text

func PatchFrom

func PatchFrom(text string) ([]diffmatchpatch.Patch, error)

PatchFrom Create a new patch from a text

func PatchString

func PatchString(text1, text2 string, checklines bool) string

PatchString Compare two strings and return the array of differences

func ProcessPatch

func ProcessPatch(p *process.Process) interface{}

ProcessPatch Compare two strings and return the patch string

func ProcessPatchApply

func ProcessPatchApply(p *process.Process) interface{}

ProcessPatchApply Apply a patch string to text

func ProcessReplace

func ProcessReplace(p *process.Process) interface{}

ProcessReplace Replace text using a patch string

func Replace

func Replace(text string, patch string) (string, error)

Replace Replace a text with a patch Format: <<<<<<< SEARCH some text ======= some other text >>>>>>> REPLACE Text Text <<<<<<< SEARCH some text 2 ======= some other text 2 >>>>>>> REPLACE Text Text 2

Types

type ReplacePatch

type ReplacePatch struct {
	Search  string
	Replace string
}

ReplacePatch struct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL