util

package
v0.0.0-...-50af7b8 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2017 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapDiff

type MapDiff struct {
	Additions map[interface{}]interface{}
	Updates   map[interface{}]interface{}
	Deletions map[interface{}]interface{}
}

The MapDiff file will hold all differences between two maps.

func DiffMapsKeys

func DiffMapsKeys(a, b map[interface{}]interface{}) *MapDiff

DiffMaps takes in 2 maps with any key/value types & returns a map with the differences, additions, updates and deletions. This function assumes both maps are sorted. If something is in "a" and not "b" we class it as an addition, if it's in "b" but not "a" we class it as a deletion. We assume "a" is the primary map. This function only compares at the first level.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳