# Mergo

> Merge structs and maps in Go

Source: https://talira.ai/catalog/mergo-ayeey93z
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / general purpose](https://talira.ai/categories/libraries/general-purpose)
- Licence: BSD-3-Clause[^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Backed by: [Dario Castañé](https://talira.ai/orgs/dario-castane.md)

Mergo is a Go library that merges structs and maps of the same type, filling zero-value fields with defaults, which helps with configuration defaults without long chains of if statements. It merges exported fields recursively, can override values, and supports transformers for custom types; it doesn't merge unexported fields or structs inside maps. Its maintainer calls it stable and frozen: new features wait for a future v2. Since 1.0.0 its import path is dario.cat/mergo (formerly github.com/imdario/mergo). It's BSD-3-Clause licensed.

## Links

- GitHub: https://github.com/darccio/mergo
- Docs: https://pkg.go.dev/dario.cat/mergo

## Problems it solves

- apply default values to a config struct in Go
- merge two Go structs without writing field-by-field code
- combine a map of overrides into my Go settings

## Features

- merge same-type structs and maps
- fill zero-value fields with defaults
- override mode
- transformers for custom types

## Limitations

- Frozen: no new features until a future v2[^1]

## Trust

Overall: 0.46 out of 1.
Signals: maintenance 0.47, adoption 0.70, momentum 0.39, community 0.73, backing 0.30, extensibility 0.00.

- last commit 49 days ago
- 3 commits in the last 90 days
- latest release v1.0.2 19 months ago
- 3.1k GitHub stars
- 65 contributors
- accepts sponsorship (Github, Tidelift, Thanks Dev)
- backed by Dario Castañé

## Sources

[^1]: https://github.com/darccio/mergo/blob/master/README.md (checked 27 Nov 2026)
[^2]: https://github.com/darccio/mergo/blob/master/LICENSE (checked 27 Nov 2026)
