diff

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package diff provides JSON diff computation and formatting utilities

Index

Constants

View Source
const MaxDiffSize = 512 * 1024 // 512KB

MaxDiffSize is the maximum size (in bytes) for detailed diff computation Files larger than this will still be compared but with simplified output

Variables

This section is empty.

Functions

func FormatDiff

func FormatDiff(result *DiffResult, useColor bool) string

FormatDiff formats diff result for display

Types

type DiffResult

type DiffResult struct {
	HasChanges   bool
	Unified      string
	Summary      string
	AddedLines   int
	DeletedLines int
}

DiffResult contains the result of a diff operation

func ComputeJSONDiff

func ComputeJSONDiff(original, modified string) (*DiffResult, error)

ComputeJSONDiff compares two JSON strings and returns structured diff

Jump to

Keyboard shortcuts

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