dcomparison

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package dcomparison provides a solution for deeply comparing two maps, including their nested maps and slices. It is designed to identify differences between two maps that can contain a variety of data types, such as strings, integers, other maps, and slices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectDiff

type ObjectDiff struct {
	Field  string
	Value1 any
	Value2 any
}

ObjectDiff stores the path to a value and the differing values from two maps.

type ObjectDiffs

type ObjectDiffs []ObjectDiff

ObjectDiffs is a slice of ObjectDiff

func MapsDiff

func MapsDiff(path string, map1, map2 map[string]any) ObjectDiffs

MapsDiff compares two maps and returns a slice of ObjectDiff with the differences.

func (*ObjectDiffs) Append

func (o *ObjectDiffs) Append(diff ObjectDiff)

Jump to

Keyboard shortcuts

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