{"action":"created","issue":{"url":"https://api.github.com/repos/go-yaml/yaml/issues/184","repository_url":"https://api.github.com/repos/go-yaml/yaml","labels_url":"https://api.github.com/repos/go-yaml/yaml/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/go-yaml/yaml/issues/184/comments","events_url":"https://api.github.com/repos/go-yaml/yaml/issues/184/events","html_url":"https://github.com/go-yaml/yaml/issues/184","id":164399534,"number":184,"title":"MapSlice does not support anchors/merges","user":{"login":"Mange","id":1599,"avatar_url":"https://avatars.githubusercontent.com/u/1599?v=3","gravatar_id":"","url":"https://api.github.com/users/Mange","html_url":"https://github.com/Mange","followers_url":"https://api.github.com/users/Mange/followers","following_url":"https://api.github.com/users/Mange/following{/other_user}","gists_url":"https://api.github.com/users/Mange/gists{/gist_id}","starred_url":"https://api.github.com/users/Mange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mange/subscriptions","organizations_url":"https://api.github.com/users/Mange/orgs","repos_url":"https://api.github.com/users/Mange/repos","events_url":"https://api.github.com/users/Mange/events{/privacy}","received_events_url":"https://api.github.com/users/Mange/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-07T20:26:42Z","updated_at":"2016-11-03T09:05:15Z","closed_at":null,"body":"Hi! I seem to have found a bug in `MapSlice`:\n\n``` go\nimport (\n    \"gopkg.in/yaml.v2\"\n    \"reflect\"\n    \"testing\"\n)\n\nfunc TestMapMerging(t *testing.T) {\n    data := `---\nworld: &world\n  greeting: Hello\nearth:\n  << : *world`\n\n    config := map[string]interface{}{}\n    err := yaml.Unmarshal([]byte(data), &config)\n    if err != nil {\n        t.Errorf(\"Failed to parse\\n%v\\n\\ninto a %T: %v\", data, config, err)\n    }\n\n    earth := config[\"earth\"]\n    expected := map[interface{}]interface{}{\n        \"greeting\": \"Hello\",\n    }\n\n    if !reflect.DeepEqual(earth, expected) {\n        t.Errorf(\"Merging does not work. Expected %v (%T), got %v (%T)\", expected, expected, earth, earth)\n    }\n}\n\nfunc TestMapSliceMerging(t *testing.T) {\n    data := `---\nworld: &world\n  greeting: Hello\nearth:\n  << : *world`\n\n    config := make(yaml.MapSlice, 0)\n    err := yaml.Unmarshal([]byte(data), &config)\n    if err != nil {\n        t.Errorf(\"Failed to parse\\n%v\\n\\ninto a %T: %v\", data, config, err)\n    }\n\n    earth := config[1].Value\n    expected := yaml.MapSlice{{Key: \"greeting\", Value: \"Hello\"}}\n\n    if !reflect.DeepEqual(earth, expected) {\n        t.Errorf(\"Merging does not work. Expected %v (%T), got %v (%T)\", expected, expected, earth, earth)\n    }\n}\n```\n\nOutput:\n\n```\n--- FAIL: TestMapSliceMerging (0.00s)\n    foo_test.go:264: Merging does not work. Expected [{greeting Hello}] (yaml.MapSlice), got [] (yaml.MapSlice)\n```\n\nNote how the test with the normal `map[string]interface{}` works properly. I'm still a beginner in Go, so I'm not sure where to start to fix this one. I have a really hard time understanding the decoding code, but a small pointer in the right direction might help me find some way of fixing this.\n"},"comment":{"url":"https://api.github.com/repos/go-yaml/yaml/issues/comments/258091564","html_url":"https://github.com/go-yaml/yaml/issues/184#issuecomment-258091564","issue_url":"https://api.github.com/repos/go-yaml/yaml/issues/184","id":258091564,"user":{"login":"vinzenz","id":36638,"avatar_url":"https://avatars.githubusercontent.com/u/36638?v=3","gravatar_id":"","url":"https://api.github.com/users/vinzenz","html_url":"https://github.com/vinzenz","followers_url":"https://api.github.com/users/vinzenz/followers","following_url":"https://api.github.com/users/vinzenz/following{/other_user}","gists_url":"https://api.github.com/users/vinzenz/gists{/gist_id}","starred_url":"https://api.github.com/users/vinzenz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinzenz/subscriptions","organizations_url":"https://api.github.com/users/vinzenz/orgs","repos_url":"https://api.github.com/users/vinzenz/repos","events_url":"https://api.github.com/users/vinzenz/events{/privacy}","received_events_url":"https://api.github.com/users/vinzenz/received_events","type":"User","site_admin":false},"created_at":"2016-11-03T09:05:15Z","updated_at":"2016-11-03T09:05:15Z","body":"@bradrydzewski @Mange Its fixed by #220 I took the liberty to add the above test cases to the tests"}}
{"actor":{"display_login":"vinzenz"}}