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

applier

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Failure

type Failure struct {
	Patch  patch.Patch
	Reason string
}

Failure records a patch that could not be applied, with why — never silently dropped. A pointer that no longer resolves (e.g. the doc was hand-edited) surfaces here so a human can reconcile it.

func Apply

func Apply(publishedRaw []byte, patches []patch.Patch) (result []byte, applied []patch.Patch, failed []Failure, err error)

Apply executes patches against the PUBLISHED document bytes (the original, not the canonical form) so human-written prose and formatting are preserved and the resulting diff stays minimal. It returns the edited bytes plus which patches applied and which failed. A failing patch does not abort the rest — partial success is the contract.

Jump to

Keyboard shortcuts

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