difflibgo

package
v0.0.0-...-93685b1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: BSD-3-Clause, MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(seqA, seqB []string) []string

Compare accepts a pair of string slices and returns a slice of their comparison -- this is just an itty bitty helper function so you don't need to create a Differ object yourself since it has no real value other than its Compare method.

func UnifiedDiff

func UnifiedDiff(a, b string) string

UnifiedDiff accepts a and b which can be strings, bytes, or something you can marshal to json and returns a python difflib style diff string or an error (if there is a marshall error).

func UnifiedDiffColorized

func UnifiedDiffColorized(a, b string) string

UnifiedDiffColorized is the same as UnifiedDiff but instead of the diff symbols (+, -, ?) the line is rewritten with green, red, yellow (respectively) colorization.

Types

type Differ

type Differ struct{}

Differ is an object that helps you compare two string slices.

func (*Differ) Compare

func (d *Differ) Compare(seqA, seqB []string) []string

Compare accepts two string slices and compares them.

Jump to

Keyboard shortcuts

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