{"action":"created","issue":{"url":"https://api.github.com/repos/ugorji/go/issues/172","repository_url":"https://api.github.com/repos/ugorji/go","labels_url":"https://api.github.com/repos/ugorji/go/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/ugorji/go/issues/172/comments","events_url":"https://api.github.com/repos/ugorji/go/issues/172/events","html_url":"https://github.com/ugorji/go/issues/172","id":177355227,"number":172,"title":"NewDecoderBytes/NewEncoderBytes cannot execute success","user":{"login":"alex023","id":12086891,"avatar_url":"https://avatars.githubusercontent.com/u/12086891?v=3","gravatar_id":"","url":"https://api.github.com/users/alex023","html_url":"https://github.com/alex023","followers_url":"https://api.github.com/users/alex023/followers","following_url":"https://api.github.com/users/alex023/following{/other_user}","gists_url":"https://api.github.com/users/alex023/gists{/gist_id}","starred_url":"https://api.github.com/users/alex023/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex023/subscriptions","organizations_url":"https://api.github.com/users/alex023/orgs","repos_url":"https://api.github.com/users/alex023/repos","events_url":"https://api.github.com/users/alex023/events{/privacy}","received_events_url":"https://api.github.com/users/alex023/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-16T06:41:30Z","updated_at":"2016-09-18T03:06:44Z","closed_at":null,"body":"##Env\r\n- golang:1.7\r\n- ugorji/go: latest update Sept. 2016\r\n\r\n##Desc\r\nuse bytes.Buffer{} ok. but use []byte as buffer of encoder/decoder , cannot execute success.\r\n\r\n##Code\r\n```Go\r\nfunc TestString_MsgPack(t *testing.T) {\r\n\tvar (\r\n\t\t//buf = bytes.NewBuffer(nil)\r\n\t\tb   []byte\r\n\t\tmh  codec.MsgpackHandle\r\n\t\tsrc string = \"jiangcheng\"\r\n\t\tdst string\r\n\t\t//dec = codec.NewDecoder(buf, &mh)\r\n\t\tdec = codec.NewDecoderBytes(b, &mh)\r\n\t\t//enc = codec.NewEncoder(buf, &mh)\r\n\t\tenc = codec.NewEncoderBytes(&b, &mh)\r\n\t)\r\n\terr1 := enc.Encode(src)\r\n\tif err1 != nil {\r\n\t\tt.Error(err1)\r\n\t}\r\n\terr2 := dec.Decode(&dst)\r\n\tif err2 != nil {\r\n\t\tt.Error(err2)\r\n\t}\r\n\tif !reflect.DeepEqual(src, dst) {\r\n\t\tt.Errorf(\"src!=dst.\\n src=%v \\n bytes=%v \\n dst=%v \\n\", src, b, dst)\r\n\t}\r\n}\r\n```\r\n\r\n##Output:\r\n```Go\r\nsrc=jiangcheng \r\nbytes=[170 106 105 97 110 103 99 104 101 110 103] \r\ndst= \r\n```"},"comment":{"url":"https://api.github.com/repos/ugorji/go/issues/comments/247821897","html_url":"https://github.com/ugorji/go/issues/172#issuecomment-247821897","issue_url":"https://api.github.com/repos/ugorji/go/issues/172","id":247821897,"user":{"login":"alex023","id":12086891,"avatar_url":"https://avatars.githubusercontent.com/u/12086891?v=3","gravatar_id":"","url":"https://api.github.com/users/alex023","html_url":"https://github.com/alex023","followers_url":"https://api.github.com/users/alex023/followers","following_url":"https://api.github.com/users/alex023/following{/other_user}","gists_url":"https://api.github.com/users/alex023/gists{/gist_id}","starred_url":"https://api.github.com/users/alex023/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex023/subscriptions","organizations_url":"https://api.github.com/users/alex023/orgs","repos_url":"https://api.github.com/users/alex023/repos","events_url":"https://api.github.com/users/alex023/events{/privacy}","received_events_url":"https://api.github.com/users/alex023/received_events","type":"User","site_admin":false},"created_at":"2016-09-18T03:06:44Z","updated_at":"2016-09-18T03:06:44Z","body":"Oh,got it.thanks @superfell @ugorji "}}
{"actor":{"display_login":"alex023"}}