diffpreview

package
v0.0.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package diffpreview generates unified diff strings for file modifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForDeletedFile

func ForDeletedFile(path, content string) string

ForDeletedFile produces a unified diff showing all lines as deletions.

func ForNewFile

func ForNewFile(path, content string) string

ForNewFile produces a unified diff showing all lines as additions.

func Generate

func Generate(path, original, modified string, moveTo ...string) string

Generate produces a unified diff string from original and modified content. path is used for the --- / +++ headers. moveTo optionally specifies a rename destination.

Types

This section is empty.

Jump to

Keyboard shortcuts

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