{"action":"closed","issue":{"url":"https://api.github.com/repos/jordanorelli/moon/issues/7","labels_url":"https://api.github.com/repos/jordanorelli/moon/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/jordanorelli/moon/issues/7/comments","events_url":"https://api.github.com/repos/jordanorelli/moon/issues/7/events","html_url":"https://github.com/jordanorelli/moon/issues/7","id":88003737,"number":7,"title":"Doc.Fill doesn't fill embedded structs.","user":{"login":"kellegous","id":54528,"avatar_url":"https://avatars.githubusercontent.com/u/54528?v=3","gravatar_id":"","url":"https://api.github.com/users/kellegous","html_url":"https://github.com/kellegous","followers_url":"https://api.github.com/users/kellegous/followers","following_url":"https://api.github.com/users/kellegous/following{/other_user}","gists_url":"https://api.github.com/users/kellegous/gists{/gist_id}","starred_url":"https://api.github.com/users/kellegous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kellegous/subscriptions","organizations_url":"https://api.github.com/users/kellegous/orgs","repos_url":"https://api.github.com/users/kellegous/repos","events_url":"https://api.github.com/users/kellegous/events{/privacy}","received_events_url":"https://api.github.com/users/kellegous/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-13T13:13:42Z","updated_at":"2015-07-14T21:11:11Z","closed_at":"2015-07-14T21:11:11Z","body":"Looks like Doc stores its values in a map and simply assigns those values directly. In the case of structs, this means it tries to assign a map[string]interface{} to a struct { ... }.\r\n\r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"log\"\r\n\r\n\t\"github.com/jordanorelli/moon\"\r\n)\r\n\r\nfunc main() {\r\n\tcfg := `\r\n\ttop: {\r\n\t\tval: some_data\r\n\t}\r\n\t`\r\n\r\n\tvar obj struct {\r\n\t\tTop *struct {\r\n\t\t\tVal string `name: val`\r\n\t\t} `name: top`\r\n\t}\r\n\r\n\tdoc, err := moon.ReadString(cfg)\r\n\tif err != nil {\r\n\t\tlog.Panic(err)\r\n\t}\r\n\r\n\tif err := doc.Fill(&obj); err != nil {\r\n\t\tlog.Panic(err)\r\n\t}\r\n\r\n\tlog.Println(obj)\r\n}\r\n```"}}