patch

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalResult

func MarshalResult(r Result) (string, error)

MarshalResult marshals a Result to JSON.

Types

type Change

type Change struct {
	Path      string `json:"path"`
	Additions int    `json:"additions"`
	Deletions int    `json:"deletions"`
}

Change represents a single file changed by a patch.

type Result

type Result struct {
	Files []Change `json:"files"`
}

Result contains metadata about an applied patch.

func Apply

func Apply(patchStr string) (Result, error)

Apply parses a unified diff and applies it to the local filesystem. It returns metadata about the applied changes.

Jump to

Keyboard shortcuts

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