maputils

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: MIT Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxDepth = 32
)

Functions

func Diff

func Diff(new, old map[string]interface{}) map[string]Change

func Merge added in v1.2.0

func Merge(dst, src map[string]interface{}) map[string]interface{}

Merge recursively merges the src and dst maps. Key conflicts are resolved by preferring src, or recursively descending, if both src and dst are maps. borrow code from https://github.com/peterbourgon/mergemap

func MergeOverwriteSlice added in v1.2.2

func MergeOverwriteSlice(dst, src map[string]interface{}) map[string]interface{}

Types

type Change

type Change struct {
	OldValue   interface{}
	NewValue   interface{}
	ChangeType ChangeType
}

type ChangeType

type ChangeType int
const (
	ADDED ChangeType = iota
	MODIFIED
	DELETED
)

Jump to

Keyboard shortcuts

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