{"action":"created","comment":{"url":"https://api.github.com/repos/tendermint/go-wire/pulls/comments/165260001","pull_request_review_id":93167404,"id":165260001,"diff_hunk":"@@ -12,65 +12,52 @@ import (\n //----------------------------------------\n // cdc.decodeReflectJSON\n \n-// CONTRACT: rv is addressable as per https://golang.org/pkg/reflect/#Value.CanAddr\n-func (cdc *Codec) decodeReflectJSON(bz []byte, info *TypeInfo, rv reflect.Value, opts FieldOptions) error {\n-\t// By this point, we MUST be dealing with an addressable value.\n+// CONTRACT: rv.CanAddr() is true.\n+func (cdc *Codec) decodeReflectJSON(bz []byte, info *TypeInfo, rv reflect.Value, opts FieldOptions) (err error) {\n \tif !rv.CanAddr() {\n-\t\tpanic(\"value is not addressable\")\n+\t\tpanic(\"rv not addressable\")\n \t}\n-\n-\t// SANITY CHECK\n \tif info.Type.Kind() == reflect.Interface && rv.Kind() == reflect.Ptr {\n \t\tpanic(\"should not happen\")\n \t}\n \n-\t// No need for diambiguation, decode as is.\n+\t// No need for disambiguation, decode as is.\n \tif !info.Registered {\n-\t\treturn cdc._decodeReflectJSON(bz, info, rv, opts)\n+\t\terr = cdc._decodeReflectJSON(bz, info, rv, opts)\n+\t\treturn\n \t}\n \n-\t// Otherwise disambiguation time\n-\tdisfix, restBlob, err := parseDisfixAndData(bz)\n+\t// Otherwise, disambiguation time.\n+\tdisfix, bz, err := decodeDisfixJSON(bz)","path":"json-decode.go","position":31,"original_position":30,"commit_id":"7536a5e7fd9e785ce450f9f07a6c7affad6cc48e","original_commit_id":"7536a5e7fd9e785ce450f9f07a6c7affad6cc48e","user":{"login":"jaekwon","id":53785,"avatar_url":"https://avatars1.githubusercontent.com/u/53785?v=4","gravatar_id":"","url":"https://api.github.com/users/jaekwon","html_url":"https://github.com/jaekwon","followers_url":"https://api.github.com/users/jaekwon/followers","following_url":"https://api.github.com/users/jaekwon/following{/other_user}","gists_url":"https://api.github.com/users/jaekwon/gists{/gist_id}","starred_url":"https://api.github.com/users/jaekwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaekwon/subscriptions","organizations_url":"https://api.github.com/users/jaekwon/orgs","repos_url":"https://api.github.com/users/jaekwon/repos","events_url":"https://api.github.com/users/jaekwon/events{/privacy}","received_events_url":"https://api.github.com/users/jaekwon/received_events","type":"User","site_admin":false},"body":"What do you think?  I like less lines of code for this kind of operation on codecs...","created_at":"2018-02-01T04:57:04Z","updated_at":"2018-02-01T04:57:04Z","html_url":"https://github.com/tendermint/go-wire/pull/93#discussion_r165260001","pull_request_url":"https://api.github.com/repos/tendermint/go-wire/pulls/93","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/tendermint/go-wire/pulls/comments/165260001"},"html":{"href":"https://github.com/tendermint/go-wire/pull/93#discussion_r165260001"},"pull_request":{"href":"https://api.github.com/repos/tendermint/go-wire/pulls/93"}}},"pull_request":{"url":"https://api.github.com/repos/tendermint/go-wire/pulls/93","id":165921974,"html_url":"https://github.com/tendermint/go-wire/pull/93","diff_url":"https://github.com/tendermint/go-wire/pull/93.diff","patch_url":"https://github.com/tendermint/go-wire/pull/93.patch","issue_url":"https://api.github.com/repos/tendermint/go-wire/issues/93","number":93,"state":"open","locked":false,"title":"WIP Suggested fixes for marshalJSON-disambiguated branch","user":{"login":"jaekwon","id":53785,"avatar_url":"https://avatars1.githubusercontent.com/u/53785?v=4","gravatar_id":"","url":"https://api.github.com/users/jaekwon","html_url":"https://github.com/jaekwon","followers_url":"https://api.github.com/users/jaekwon/followers","following_url":"https://api.github.com/users/jaekwon/following{/other_user}","gists_url":"https://api.github.com/users/jaekwon/gists{/gist_id}","starred_url":"https://api.github.com/users/jaekwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaekwon/subscriptions","organizations_url":"https://api.github.com/users/jaekwon/orgs","repos_url":"https://api.github.com/users/jaekwon/repos","events_url":"https://api.github.com/users/jaekwon/events{/privacy}","received_events_url":"https://api.github.com/users/jaekwon/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-01-30T09:08:28Z","updated_at":"2018-02-01T04:57:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"03b17e4dde15efd7ab2329894e53f105b03d1c54","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/tendermint/go-wire/pulls/93/commits","review_comments_url":"https://api.github.com/repos/tendermint/go-wire/pulls/93/comments","review_comment_url":"https://api.github.com/repos/tendermint/go-wire/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tendermint/go-wire/issues/93/comments","statuses_url":"https://api.github.com/repos/tendermint/go-wire/statuses/7536a5e7fd9e785ce450f9f07a6c7affad6cc48e","head":{"label":"tendermint:sdk2-marshalJSON-disambiguated-jae","ref":"sdk2-marshalJSON-disambiguated-jae","sha":"7536a5e7fd9e785ce450f9f07a6c7affad6cc48e","user":{"login":"tendermint","id":7572940,"avatar_url":"https://avatars1.githubusercontent.com/u/7572940?v=4","gravatar_id":"","url":"https://api.github.com/users/tendermint","html_url":"https://github.com/tendermint","followers_url":"https://api.github.com/users/tendermint/followers","following_url":"https://api.github.com/users/tendermint/following{/other_user}","gists_url":"https://api.github.com/users/tendermint/gists{/gist_id}","starred_url":"https://api.github.com/users/tendermint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tendermint/subscriptions","organizations_url":"https://api.github.com/users/tendermint/orgs","repos_url":"https://api.github.com/users/tendermint/repos","events_url":"https://api.github.com/users/tendermint/events{/privacy}","received_events_url":"https://api.github.com/users/tendermint/received_events","type":"Organization","site_admin":false},"repo":{"id":44698621,"name":"go-wire","full_name":"tendermint/go-wire","owner":{"login":"tendermint","id":7572940,"avatar_url":"https://avatars1.githubusercontent.com/u/7572940?v=4","gravatar_id":"","url":"https://api.github.com/users/tendermint","html_url":"https://github.com/tendermint","followers_url":"https://api.github.com/users/tendermint/followers","following_url":"https://api.github.com/users/tendermint/following{/other_user}","gists_url":"https://api.github.com/users/tendermint/gists{/gist_id}","starred_url":"https://api.github.com/users/tendermint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tendermint/subscriptions","organizations_url":"https://api.github.com/users/tendermint/orgs","repos_url":"https://api.github.com/users/tendermint/repos","events_url":"https://api.github.com/users/tendermint/events{/privacy}","received_events_url":"https://api.github.com/users/tendermint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tendermint/go-wire","description":"Go library for encoding/decoding structures into binary and JSON format.","fork":false,"url":"https://api.github.com/repos/tendermint/go-wire","forks_url":"https://api.github.com/repos/tendermint/go-wire/forks","keys_url":"https://api.github.com/repos/tendermint/go-wire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tendermint/go-wire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tendermint/go-wire/teams","hooks_url":"https://api.github.com/repos/tendermint/go-wire/hooks","issue_events_url":"https://api.github.com/repos/tendermint/go-wire/issues/events{/number}","events_url":"https://api.github.com/repos/tendermint/go-wire/events","assignees_url":"https://api.github.com/repos/tendermint/go-wire/assignees{/user}","branches_url":"https://api.github.com/repos/tendermint/go-wire/branches{/branch}","tags_url":"https://api.github.com/repos/tendermint/go-wire/tags","blobs_url":"https://api.github.com/repos/tendermint/go-wire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tendermint/go-wire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tendermint/go-wire/git/refs{/sha}","trees_url":"https://api.github.com/repos/tendermint/go-wire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tendermint/go-wire/statuses/{sha}","languages_url":"https://api.github.com/repos/tendermint/go-wire/languages","stargazers_url":"https://api.github.com/repos/tendermint/go-wire/stargazers","contributors_url":"https://api.github.com/repos/tendermint/go-wire/contributors","subscribers_url":"https://api.github.com/repos/tendermint/go-wire/subscribers","subscription_url":"https://api.github.com/repos/tendermint/go-wire/subscription","commits_url":"https://api.github.com/repos/tendermint/go-wire/commits{/sha}","git_commits_url":"https://api.github.com/repos/tendermint/go-wire/git/commits{/sha}","comments_url":"https://api.github.com/repos/tendermint/go-wire/comments{/number}","issue_comment_url":"https://api.github.com/repos/tendermint/go-wire/issues/comments{/number}","contents_url":"https://api.github.com/repos/tendermint/go-wire/contents/{+path}","compare_url":"https://api.github.com/repos/tendermint/go-wire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tendermint/go-wire/merges","archive_url":"https://api.github.com/repos/tendermint/go-wire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tendermint/go-wire/downloads","issues_url":"https://api.github.com/repos/tendermint/go-wire/issues{/number}","pulls_url":"https://api.github.com/repos/tendermint/go-wire/pulls{/number}","milestones_url":"https://api.github.com/repos/tendermint/go-wire/milestones{/number}","notifications_url":"https://api.github.com/repos/tendermint/go-wire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tendermint/go-wire/labels{/name}","releases_url":"https://api.github.com/repos/tendermint/go-wire/releases{/id}","deployments_url":"https://api.github.com/repos/tendermint/go-wire/deployments","created_at":"2015-10-21T19:16:59Z","updated_at":"2018-01-25T11:26:37Z","pushed_at":"2018-02-01T04:31:19Z","git_url":"git://github.com/tendermint/go-wire.git","ssh_url":"git@github.com:tendermint/go-wire.git","clone_url":"https://github.com/tendermint/go-wire.git","svn_url":"https://github.com/tendermint/go-wire","homepage":null,"size":6676,"stargazers_count":26,"watchers_count":26,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":35,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":14,"open_issues":35,"watchers":26,"default_branch":"master"}},"base":{"label":"tendermint:sdk2-marshalJSON-disambiguated","ref":"sdk2-marshalJSON-disambiguated","sha":"aa68844e457964c34640a2e1f21740f164e4dbf6","user":{"login":"tendermint","id":7572940,"avatar_url":"https://avatars1.githubusercontent.com/u/7572940?v=4","gravatar_id":"","url":"https://api.github.com/users/tendermint","html_url":"https://github.com/tendermint","followers_url":"https://api.github.com/users/tendermint/followers","following_url":"https://api.github.com/users/tendermint/following{/other_user}","gists_url":"https://api.github.com/users/tendermint/gists{/gist_id}","starred_url":"https://api.github.com/users/tendermint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tendermint/subscriptions","organizations_url":"https://api.github.com/users/tendermint/orgs","repos_url":"https://api.github.com/users/tendermint/repos","events_url":"https://api.github.com/users/tendermint/events{/privacy}","received_events_url":"https://api.github.com/users/tendermint/received_events","type":"Organization","site_admin":false},"repo":{"id":44698621,"name":"go-wire","full_name":"tendermint/go-wire","owner":{"login":"tendermint","id":7572940,"avatar_url":"https://avatars1.githubusercontent.com/u/7572940?v=4","gravatar_id":"","url":"https://api.github.com/users/tendermint","html_url":"https://github.com/tendermint","followers_url":"https://api.github.com/users/tendermint/followers","following_url":"https://api.github.com/users/tendermint/following{/other_user}","gists_url":"https://api.github.com/users/tendermint/gists{/gist_id}","starred_url":"https://api.github.com/users/tendermint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tendermint/subscriptions","organizations_url":"https://api.github.com/users/tendermint/orgs","repos_url":"https://api.github.com/users/tendermint/repos","events_url":"https://api.github.com/users/tendermint/events{/privacy}","received_events_url":"https://api.github.com/users/tendermint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tendermint/go-wire","description":"Go library for encoding/decoding structures into binary and JSON format.","fork":false,"url":"https://api.github.com/repos/tendermint/go-wire","forks_url":"https://api.github.com/repos/tendermint/go-wire/forks","keys_url":"https://api.github.com/repos/tendermint/go-wire/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tendermint/go-wire/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tendermint/go-wire/teams","hooks_url":"https://api.github.com/repos/tendermint/go-wire/hooks","issue_events_url":"https://api.github.com/repos/tendermint/go-wire/issues/events{/number}","events_url":"https://api.github.com/repos/tendermint/go-wire/events","assignees_url":"https://api.github.com/repos/tendermint/go-wire/assignees{/user}","branches_url":"https://api.github.com/repos/tendermint/go-wire/branches{/branch}","tags_url":"https://api.github.com/repos/tendermint/go-wire/tags","blobs_url":"https://api.github.com/repos/tendermint/go-wire/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tendermint/go-wire/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tendermint/go-wire/git/refs{/sha}","trees_url":"https://api.github.com/repos/tendermint/go-wire/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tendermint/go-wire/statuses/{sha}","languages_url":"https://api.github.com/repos/tendermint/go-wire/languages","stargazers_url":"https://api.github.com/repos/tendermint/go-wire/stargazers","contributors_url":"https://api.github.com/repos/tendermint/go-wire/contributors","subscribers_url":"https://api.github.com/repos/tendermint/go-wire/subscribers","subscription_url":"https://api.github.com/repos/tendermint/go-wire/subscription","commits_url":"https://api.github.com/repos/tendermint/go-wire/commits{/sha}","git_commits_url":"https://api.github.com/repos/tendermint/go-wire/git/commits{/sha}","comments_url":"https://api.github.com/repos/tendermint/go-wire/comments{/number}","issue_comment_url":"https://api.github.com/repos/tendermint/go-wire/issues/comments{/number}","contents_url":"https://api.github.com/repos/tendermint/go-wire/contents/{+path}","compare_url":"https://api.github.com/repos/tendermint/go-wire/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tendermint/go-wire/merges","archive_url":"https://api.github.com/repos/tendermint/go-wire/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tendermint/go-wire/downloads","issues_url":"https://api.github.com/repos/tendermint/go-wire/issues{/number}","pulls_url":"https://api.github.com/repos/tendermint/go-wire/pulls{/number}","milestones_url":"https://api.github.com/repos/tendermint/go-wire/milestones{/number}","notifications_url":"https://api.github.com/repos/tendermint/go-wire/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tendermint/go-wire/labels{/name}","releases_url":"https://api.github.com/repos/tendermint/go-wire/releases{/id}","deployments_url":"https://api.github.com/repos/tendermint/go-wire/deployments","created_at":"2015-10-21T19:16:59Z","updated_at":"2018-01-25T11:26:37Z","pushed_at":"2018-02-01T04:31:19Z","git_url":"git://github.com/tendermint/go-wire.git","ssh_url":"git@github.com:tendermint/go-wire.git","clone_url":"https://github.com/tendermint/go-wire.git","svn_url":"https://github.com/tendermint/go-wire","homepage":null,"size":6676,"stargazers_count":26,"watchers_count":26,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":35,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":14,"open_issues":35,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tendermint/go-wire/pulls/93"},"html":{"href":"https://github.com/tendermint/go-wire/pull/93"},"issue":{"href":"https://api.github.com/repos/tendermint/go-wire/issues/93"},"comments":{"href":"https://api.github.com/repos/tendermint/go-wire/issues/93/comments"},"review_comments":{"href":"https://api.github.com/repos/tendermint/go-wire/pulls/93/comments"},"review_comment":{"href":"https://api.github.com/repos/tendermint/go-wire/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tendermint/go-wire/pulls/93/commits"},"statuses":{"href":"https://api.github.com/repos/tendermint/go-wire/statuses/7536a5e7fd9e785ce450f9f07a6c7affad6cc48e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jaekwon"}}