{"id":16513925,"url":"https://github.com/twin/deepmerge","last_synced_at":"2025-10-28T04:32:22.256Z","repository":{"id":65193356,"uuid":"586381028","full_name":"TwiN/deepmerge","owner":"TwiN","description":"Go library for deep merging YAML or JSON","archived":false,"fork":false,"pushed_at":"2025-01-14T04:10:39.000Z","size":21,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T11:34:54.181Z","etag":null,"topics":["deep-merge","deepmerge","go","golang","json","library","merge","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TwiN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["TwiN"]}},"created_at":"2023-01-07T23:21:40.000Z","updated_at":"2025-01-25T19:12:17.000Z","dependencies_parsed_at":"2024-02-18T15:28:24.171Z","dependency_job_id":"5d6e0ac2-a9c0-4880-ada6-9c291a43912d","html_url":"https://github.com/TwiN/deepmerge","commit_stats":{"total_commits":13,"total_committers":2,"mean_commits":6.5,"dds":"0.23076923076923073","last_synced_commit":"9b7dc65e91bb11b1f42822cb001d3f63b6c90ea8"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":"TwiN/template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2Fdeepmerge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2Fdeepmerge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2Fdeepmerge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TwiN%2Fdeepmerge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TwiN","download_url":"https://codeload.github.com/TwiN/deepmerge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238597386,"owners_count":19498396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-merge","deepmerge","go","golang","json","library","merge","yaml"],"created_at":"2024-10-11T16:10:52.834Z","updated_at":"2025-10-28T04:32:21.899Z","avatar_url":"https://github.com/TwiN.png","language":"Go","funding_links":["https://github.com/sponsors/TwiN"],"categories":[],"sub_categories":[],"readme":"# deepmerge\n![test](https://github.com/TwiN/deepmerge/actions/workflows/test.yml/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/TwiN/deepmerge)](https://goreportcard.com/report/github.com/TwiN/deepmerge)\n[![Go version](https://img.shields.io/github/go-mod/go-version/TwiN/deepmerge.svg)](https://github.com/TwiN/deepmerge)\n[![Go Reference](https://pkg.go.dev/badge/github.com/TwiN/deepmerge.svg)](https://pkg.go.dev/github.com/TwiN/deepmerge)\n\nGo library for deep merging YAML or JSON files.\n\n\n## Usage\n\n### YAML\n```go\npackage main\n\nimport (\n\t\"github.com/TwiN/deepmerge\"\n)\n\nfunc main() {\n\tdst := `\ndebug: true\nclient:\n  insecure: true\nusers:\n  - id: 1\n    firstName: John\n    lastName: Doe\n  - id: 2\n    firstName: Jane\n    lastName: Doe`\n\tsrc := `\nclient:\n  timeout: 5s\nusers:\n  - id: 3\n    firstName: Bob\n    lastName: Smith`\n\toutput, err := deepmerge.YAML([]byte(dst), []byte(src))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tprintln(string(output))\n}\n```\n\nOutput:\n```yaml\nclient:\n    insecure: true\n    timeout: 5s\ndebug: true\nusers:\n    - firstName: John\n      id: 1\n      lastName: Doe\n    - firstName: Jane\n      id: 2\n      lastName: Doe\n    - firstName: Bob\n      id: 3\n      lastName: Smith\n```\n\n### JSON\n```go\npackage main\n\nimport (\n\t\"github.com/TwiN/deepmerge\"\n)\n\nfunc main() {\n\tdst := `{\n  \"debug\": true,\n  \"client\": {\n    \"insecure\": true\n  },\n  \"users\": [\n    {\n      \"id\": 1,\n      \"firstName\": \"John\",\n      \"lastName\": \"Doe\"\n    },\n    {\n      \"id\": 2,\n      \"firstName\": \"Jane\",\n      \"lastName\": \"Doe\"\n    }\n  ]\n}`\n\tsrc := `{\n  \"client\": {\n    \"timeout\": \"5s\"\n  },\n  \"users\": [\n    {\n      \"id\": 3,\n      \"firstName\": \"Bob\",\n      \"lastName\": \"Smith\"\n    }\n  ]\n}`\n\toutput, err := deepmerge.JSON([]byte(dst), []byte(src))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tprintln(string(output))\n}\n```\n\nOutput:\n```json\n{\n  \"client\": {\n    \"insecure\": true,\n    \"timeout\": \"5s\"\n  },\n  \"debug\": true,\n  \"users\": [\n    {\n      \"firstName\": \"John\",\n      \"id\": 1,\n      \"lastName\": \"Doe\"\n    },\n    {\n      \"firstName\": \"Jane\",\n      \"id\": 2,\n      \"lastName\": \"Doe\"\n    },\n    {\n      \"firstName\": \"Bob\",\n      \"id\": 3,\n      \"lastName\": \"Smith\"\n    }\n  ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwin%2Fdeepmerge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwin%2Fdeepmerge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwin%2Fdeepmerge/lists"}