An open API service providing repository metadata for many open source software ecosystems.

Package Usage: go: github.com/imdario/mergo

A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements. Mergo merges same-type structs and maps by setting default values in zero-value fields. Mergo won't merge unexported (private) fields. It will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection). It is ready for production use. It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc. Please keep in mind that a problematic PR broke 0.3.9. We reverted it in 0.3.10. We consider 0.3.10 as stable but not bug-free. . Also, this version adds suppot for go modules. Keep in mind that in 0.3.2, Mergo changed Merge() and Map() signatures to support transformers. We added an optional/variadic argument so that it won't break the existing code. If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with go get -u github.com/imdario/mergo. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). Do your usual installation procedure: You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as they are zero values too. Also, maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection). Also, you can merge overwriting values using the transformer WithOverride. Additionally, you can map a map[string]interface{} to a struct (and otherwise, from struct to map), following the same restrictions as in Merge(). Keys are capitalized to find each corresponding exported field. Warning: if you map a struct to map, it won't do it recursively. Don't expect Mergo to map struct members of your struct as map[string]interface{}. They will be just assigned as values. Here is a nice example: Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, time.Time is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero time.Time? If I can help you, you have an idea or you are using Mergo in your projects, don't hesitate to drop me a line (or a pull request): https://twitter.com/im_dario Written by Dario Castañé: https://da.rio.hn BSD 3-Clause license, as Go language.
15 versions
Latest release: almost 2 years ago
29,734 dependent packages

View more package details: https://packages.ecosyste.ms/registries/proxy.golang.org/packages/github.com/imdario/mergo

View more repository details: http://repos.ecosyste.ms/hosts/GitHub/repositories/darccio%2Fmergo

Dependent Repos 61,876

admariner/jitsu Fork of jitsucom/jitsu
Jitsu is an open-source data integration platform

Size: 29.4 MB - Last synced: 2 days ago - Pushed: almost 2 years ago

kmodules/resource-metadata
API for defining metadata about Kubernetes resources

Size: 85 MB - Last synced: 12 days ago - Pushed: 12 days ago

ossf/scorecard-action
Official GitHub Action for OpenSSF Scorecard.

Size: 6.93 MB - Last synced: 3 days ago - Pushed: 7 days ago

zeromike/syft Fork of anchore/syft
CLI tool and library for generating a Software Bill of Materials from container images and filesystems

Size: 10.4 MB - Last synced: 10 months ago - Pushed: almost 3 years ago

aberja/argo Fork of argoproj/argo-workflows
Argo Workflows: Get stuff done with Kubernetes.

Size: 66.8 MB - Last synced: 11 months ago - Pushed: about 2 years ago

krasish/test-infra Fork of kyma-project/test-infra
Test infrastructure for the Kyma project.

Size: 15.3 MB - Last synced: about 2 years ago - Pushed: about 2 years ago

spolti/kie-cloud-operator Fork of kiegroup/kie-cloud-operator
OCP Operator for KIE

Size: 100 MB - Last synced: 7 months ago - Pushed: over 1 year ago

dhis2-sre/im-inspector

Size: 411 KB - Last synced: 19 days ago - Pushed: 19 days ago

cheqd/tendermint Fork of tendermint/tendermint
⟁ Tendermint Core (BFT Consensus) in Go

Size: 142 MB - Last synced: 10 months ago - Pushed: about 2 years ago

alicefr/kubevirt Fork of kubevirt/kubevirt
Kubernetes Virtualization API and runtime in order to define and manage virtual machines.

Size: 283 MB - Last synced: 7 days ago - Pushed: 7 days ago

ryanlycch/go-zero-looklook Fork of Mikaelemmmm/go-zero-looklook
🔥基于go-zero(go zero) 微服务全技术栈开发最佳实践项目。Develop best practice projects based on the full technology stack of go zero (go zero) microservices.

Size: 101 MB - Last synced: 3 months ago - Pushed: 3 months ago

ahmedabu98/beam Fork of apache/beam
Apache Beam is a unified programming model for Batch and Streaming

Size: 391 MB - Last synced: 6 days ago - Pushed: 6 days ago

champ-oss/terraform-aws-metabase

Size: 268 KB - Last synced: 27 days ago - Pushed: 27 days ago

SammyEnigma/hardentools Fork of hardentools/hardentools
Hardentools simply reduces the attack surface on Microsoft Windows computers by disabling low-hanging fruit risky features.

Size: 3.34 MB - Last synced: over 1 year ago - Pushed: over 1 year ago

fahedouch/crossplane-runtime Fork of crossplane/crossplane-runtime
A set of libraries for writing Crossplane controllers.

Size: 2.37 MB - Last synced: 10 months ago - Pushed: 11 months ago

nakamasato/mysql-operator
Manage MySQL users, databases, schemas, etc.

Size: 1.71 MB - Last synced: 5 days ago - Pushed: 5 days ago

Jimdo/terraform-provider-solaris 📦
Terraform provider to provision static resources using the Solarisbank API.

Size: 4.6 MB - Last synced: about 2 months ago - Pushed: about 2 months ago

observIQ/grafana-agent Fork of grafana/agent
Telemetry agent for the LGTM stack.

Size: 48.3 MB - Last synced: over 1 year ago - Pushed: over 1 year ago