Registry / utility / imdario-mergo

imdario-mergo

JSON →
library1.0.2gogounverified

A helper to merge structs and maps in Golang.

go get github.com/imdario/mergo
INSTALL
IMPORT
SIG · IMDARIO-MERGO
I
imdario-mergo
utilitygov1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mergo
github.com/imdario/mergo

Merge two maps together

package main import ( "fmt" "github.com/imdario/mergo" ) func main() { src := map[string]interface{}{"a": 1, "b": 2} dst := map[string]interface{}{"b": 3, "c": 4} mergo.Merge(&dst, src) fmt.Println(dst) }
Debug
Known issues
breakingMergo v1.0.0 changed default behavior; zero values may overwrite
fix
Use mergo.WithOverride or mergo.WithOverwriteWithEmptyValue to control behavior
affects: >=1.0.0
Upgrade
Version history
1.0.2latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
imdario-mergo — go get imdario-mergo · libregistry