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

edit

package
v0.0.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(original []byte, updates map[string]model.Value) ([]byte, error)

Set applies updates to a document's frontmatter, preserving key order, comments, quoting, and line endings, and never touching the body.

func UnifiedDiff

func UnifiedDiff(path string, old, new []byte) string

UnifiedDiff returns a git-apply-compatible unified diff for one file.

func WriteAtomic

func WriteAtomic(path string, data []byte, mode os.FileMode) error

WriteAtomic writes data to path via a same-directory temp file and rename, preserving mode. Rename is only atomic within one filesystem, so the temp file must share the destination directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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