maputils

package
v2.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 2 Imported by: 0

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

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

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