Documentation
¶
Index ¶
- func ApplyDiff(original string, result *DiffResult) (string, error)
- func ApplyPatch(filePath, patch string) error
- func FormatDiff(diff *DiffResult, colorize bool) string
- func GenerateUnifiedDiff(original, updated, originalName, updatedName string) string
- func WriteDiffToFile(diff *DiffResult, filePath string) error
- type DiffHunk
- type DiffResult
- type DiffStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyDiff ¶
func ApplyDiff(original string, result *DiffResult) (string, error)
ApplyDiff applies the changes from a DiffResult to a string
func ApplyPatch ¶
ApplyPatch applies a patch in unified diff format to a file
func FormatDiff ¶
func FormatDiff(diff *DiffResult, colorize bool) string
FormatDiff formats a DiffResult for display
func GenerateUnifiedDiff ¶
GenerateUnifiedDiff creates a unified diff format string
func WriteDiffToFile ¶
func WriteDiffToFile(diff *DiffResult, filePath string) error
WriteDiffToFile writes a diff to a file
Types ¶
type DiffResult ¶
DiffResult represents the difference between two files
func CompareFunctions ¶
func CompareFunctions(oldFunc, newFunc string) *DiffResult
CompareFunctions compares two versions of a function and returns a diff
func GenerateDiff ¶
func GenerateDiff(original, updated string) *DiffResult
GenerateDiff creates a diff between two strings
Click to show internal directories.
Click to hide internal directories.