This package browser is in early development. Mind the rough edges.

go-dario-cat-mergo

Helper to merge structs and maps in Golang

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).

Installation

Install the latest version of go-dario-cat-mergo as follows:

guix install go-dario-cat-mergo

Or install a particular version:

guix install go-dario-cat-mergo@1.0.2

You can also install packages in augmented, pure or containerized environments for development or simply to try them out without polluting your user profile. See the guix shell documentation for more information.

Badge code

You can use the following badge to inform users of go-dario-cat-mergo about the latest version available in Guix.

Example HTML:

<a href='https://packages.guix.gnu.org/packages/go-dario-cat-mergo'><img src='https://packages.guix.gnu.org/packages/go-dario-cat-mergo/badges/latest-version.svg' alt='Version in GNU Guix'></a>

Example Markdown:

[![Version in GNU Guix](https://packages.guix.gnu.org/packages/go-dario-cat-mergo/badges/latest-version.svg)](https://packages.guix.gnu.org/packages/go-dario-cat-mergo)

Example Org:

[[https://packages.guix.gnu.org/packages/go-dario-cat-mergo][https://packages.guix.gnu.org/packages/go-dario-cat-mergo/badges/latest-version.svg]]