{"action":"opened","issue":{"url":"https://api.github.com/repos/vmihailenco/msgpack/issues/20","labels_url":"https://api.github.com/repos/vmihailenco/msgpack/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/vmihailenco/msgpack/issues/20/comments","events_url":"https://api.github.com/repos/vmihailenco/msgpack/issues/20/events","html_url":"https://github.com/vmihailenco/msgpack/issues/20","id":54767438,"number":20,"title":"Embedded time","user":{"login":"fredr","id":762956,"avatar_url":"https://avatars.githubusercontent.com/u/762956?v=3","gravatar_id":"","url":"https://api.github.com/users/fredr","html_url":"https://github.com/fredr","followers_url":"https://api.github.com/users/fredr/followers","following_url":"https://api.github.com/users/fredr/following{/other_user}","gists_url":"https://api.github.com/users/fredr/gists{/gist_id}","starred_url":"https://api.github.com/users/fredr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredr/subscriptions","organizations_url":"https://api.github.com/users/fredr/orgs","repos_url":"https://api.github.com/users/fredr/repos","events_url":"https://api.github.com/users/fredr/events{/privacy}","received_events_url":"https://api.github.com/users/fredr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-19T14:03:32Z","updated_at":"2015-01-19T14:03:32Z","closed_at":null,"body":"We have embedded times in our code, like this:\r\n```go\r\ntype CustomTime struct {\r\n    time.Time\r\n}\r\n```\r\n\r\nThese have encoded ok in the past, but when I updated msgpack they will always encode to nil.\r\nSee this example code: https://gist.github.com/fredr/be78ebe33b894ef4c833\r\n\r\nRun it on commit 42dfffd677df0a8ac272849ced79a2e8de19c66a and it will work fine, output:\r\n```\r\ni: main.Thing{T1:time.Time{sec:63557272447, nsec:0x207cedd1, loc:(*time.Location)(0x1a2940)}, T2:main.EmbTime{Time:time.Time{sec:63557272447, nsec:0x207cedd1, loc:(*time.Location)(0x1a2940)}}}\r\n\r\n[130 162 84 49 146 210 84 189 12 127 210 32 124 237 209 162 84 50 129 164 84 105 109 101 146 210 84 189 12 127 210 32 124 237 209]\r\n\r\nout: map[interface {}]interface {}{\"T1\":[]interface {}{1421675647, 545058257}, \"T2\":map[interface {}]interface {}{\"Time\":[]interface {}{1421675647, 545058257}}}\r\n```\r\nRun it on commit ab83284640a5c55124cd6416a723782e1b276b5d and T2 will be empty after encode/decode:\r\n```\r\ni: main.Thing{T1:time.Time{sec:63557272432, nsec:0xf7b18ad, loc:(*time.Location)(0x19d920)}, T2:main.EmbTime{Time:time.Time{sec:63557272432, nsec:0xf7b18ad, loc:(*time.Location)(0x19d920)}}}\r\n\r\n[130 162 84 49 146 210 84 189 12 112 210 15 123 24 173 162 84 50 128]\r\n\r\nout: map[interface {}]interface {}{\"T1\":[]interface {}{1421675632, 259725485}, \"T2\":map[interface {}]interface {}{}}\r\n```\r\n\r\n"}}