{"action":"created","issue":{"url":"https://api.github.com/repos/imdario/mergo/issues/10","labels_url":"https://api.github.com/repos/imdario/mergo/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/imdario/mergo/issues/10/comments","events_url":"https://api.github.com/repos/imdario/mergo/issues/10/events","html_url":"https://github.com/imdario/mergo/issues/10","id":56378361,"number":10,"title":"Unclear documentation","user":{"login":"elwinar","id":4218466,"avatar_url":"https://avatars.githubusercontent.com/u/4218466?v=3","gravatar_id":"","url":"https://api.github.com/users/elwinar","html_url":"https://github.com/elwinar","followers_url":"https://api.github.com/users/elwinar/followers","following_url":"https://api.github.com/users/elwinar/following{/other_user}","gists_url":"https://api.github.com/users/elwinar/gists{/gist_id}","starred_url":"https://api.github.com/users/elwinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elwinar/subscriptions","organizations_url":"https://api.github.com/users/elwinar/orgs","repos_url":"https://api.github.com/users/elwinar/repos","events_url":"https://api.github.com/users/elwinar/events{/privacy}","received_events_url":"https://api.github.com/users/elwinar/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-03T13:38:56Z","updated_at":"2015-04-06T19:52:02Z","closed_at":"2015-04-06T19:52:02Z","body":"I find the description of the `Merge` method quite unclear: after reading, I thought that zero-value fields of the destination were overridden by the matching field of the source. I had to dig in the source code and the tests to understand it worked the other way around.\r\n\r\nIt may have to do with me being tired, but I think that providing a simple and visual example that can be copy-pasted for demonstration would be a nice thing to have in the readme. For example:\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"github.com/imdario/mergo\"\r\n)\r\n\r\ntype Foo struct {\r\n\tA string\r\n\tB int64\r\n}\r\n\r\nfunc main() {\r\n\tsrc := Foo{\r\n\t\tA: \"one\",\r\n\t}\r\n\r\n\tdest := Foo{\r\n\t\tA: \"two\",\r\n\t\tB: 2,\r\n\t}\r\n\r\n\tmergo.Merge(&dest, src)\r\n\r\n\tfmt.Println(dest)\r\n\t// Will print\r\n\t// {one 2}\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/imdario/mergo/issues/comments/90220790","html_url":"https://github.com/imdario/mergo/issues/10#issuecomment-90220790","issue_url":"https://api.github.com/repos/imdario/mergo/issues/10","id":90220790,"user":{"login":"imdario","id":163009,"avatar_url":"https://avatars.githubusercontent.com/u/163009?v=3","gravatar_id":"","url":"https://api.github.com/users/imdario","html_url":"https://github.com/imdario","followers_url":"https://api.github.com/users/imdario/followers","following_url":"https://api.github.com/users/imdario/following{/other_user}","gists_url":"https://api.github.com/users/imdario/gists{/gist_id}","starred_url":"https://api.github.com/users/imdario/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imdario/subscriptions","organizations_url":"https://api.github.com/users/imdario/orgs","repos_url":"https://api.github.com/users/imdario/repos","events_url":"https://api.github.com/users/imdario/events{/privacy}","received_events_url":"https://api.github.com/users/imdario/received_events","type":"User","site_admin":false},"created_at":"2015-04-06T19:52:02Z","updated_at":"2015-04-06T19:52:02Z","body":"Done. Thanks for you feedback!"}}