deepmerge

package module
v0.0.0-...-7ec7dbb Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: MIT Imports: 2 Imported by: 2

README

go-deepmerge

Merge the enumerable attributes of two interface deeply.

example

a := map[string]interface{}{
    "foo": "bar",
    "hoge": "huga",
    "array": []interface{}{1, 2, 3},
}

b := map[string]interface{}{
    "john": "doe",
    "hoge": "huga",
    "array": []interface{}{1, 2, "fizz", 4, "buzz"},
}

c, _ := Merge(a, b)

c => 
map[string]interface{}{
    "foo": "bar",
    "john": "doe",
    "hoge": "huga",
    "array": []interface{}{1, 2, 3, 1, 2, "fizz", 4, "buzz"},
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeNotMatchErr = errors.New("type not match")
)

Functions

func Merge

func Merge(src, dst interface{}) (interface{}, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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