{"action":"created","comment":{"url":"https://api.github.com/repos/robertkrimen/otto/pulls/comments/51397408","id":51397408,"diff_hunk":"@@ -0,0 +1,6 @@\n+","path":"AUTHORS","position":1,"original_position":1,"commit_id":"8de86048d79444d79c4c081649ae6ee11a9283ba","original_commit_id":"8de86048d79444d79c4c081649ae6ee11a9283ba","user":{"login":"darkliquid","id":31256,"avatar_url":"https://avatars.githubusercontent.com/u/31256?v=3","gravatar_id":"","url":"https://api.github.com/users/darkliquid","html_url":"https://github.com/darkliquid","followers_url":"https://api.github.com/users/darkliquid/followers","following_url":"https://api.github.com/users/darkliquid/following{/other_user}","gists_url":"https://api.github.com/users/darkliquid/gists{/gist_id}","starred_url":"https://api.github.com/users/darkliquid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkliquid/subscriptions","organizations_url":"https://api.github.com/users/darkliquid/orgs","repos_url":"https://api.github.com/users/darkliquid/repos","events_url":"https://api.github.com/users/darkliquid/events{/privacy}","received_events_url":"https://api.github.com/users/darkliquid/received_events","type":"User","site_admin":false},"body":"Is this file necessary?","created_at":"2016-02-01T09:51:18Z","updated_at":"2016-02-01T09:51:18Z","html_url":"https://github.com/robertkrimen/otto/pull/158#discussion_r51397408","pull_request_url":"https://api.github.com/repos/robertkrimen/otto/pulls/158","_links":{"self":{"href":"https://api.github.com/repos/robertkrimen/otto/pulls/comments/51397408"},"html":{"href":"https://github.com/robertkrimen/otto/pull/158#discussion_r51397408"},"pull_request":{"href":"https://api.github.com/repos/robertkrimen/otto/pulls/158"}}},"pull_request":{"url":"https://api.github.com/repos/robertkrimen/otto/pulls/158","id":57747636,"html_url":"https://github.com/robertkrimen/otto/pull/158","diff_url":"https://github.com/robertkrimen/otto/pull/158.diff","patch_url":"https://github.com/robertkrimen/otto/pull/158.patch","issue_url":"https://api.github.com/repos/robertkrimen/otto/issues/158","number":158,"state":"open","locked":false,"title":"value.ToStruct()","user":{"login":"rsdoiel","id":169021,"avatar_url":"https://avatars.githubusercontent.com/u/169021?v=3","gravatar_id":"","url":"https://api.github.com/users/rsdoiel","html_url":"https://github.com/rsdoiel","followers_url":"https://api.github.com/users/rsdoiel/followers","following_url":"https://api.github.com/users/rsdoiel/following{/other_user}","gists_url":"https://api.github.com/users/rsdoiel/gists{/gist_id}","starred_url":"https://api.github.com/users/rsdoiel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsdoiel/subscriptions","organizations_url":"https://api.github.com/users/rsdoiel/orgs","repos_url":"https://api.github.com/users/rsdoiel/repos","events_url":"https://api.github.com/users/rsdoiel/events{/privacy}","received_events_url":"https://api.github.com/users/rsdoiel/received_events","type":"User","site_admin":false},"body":"I added a convenience function to value called ToStruct. It wraps an value.Export() with a json.Marshal(), json.Unmarshal() call to populate a struct.  Here's how it might be used.\r\n\r\naStruct := {\r\n   One: 1 `json:\"one\"`\r\n   Two: \"Two\" `json:\"two\"`\r\n}{}\r\n\r\nval, _ := vm.Run(`(function(){ return { one: 1, two: \"two\"};}())`)\r\nerr := val.ToStruct(&aStruct)\r\n\r\nfmt.Printf(\"One: %d, Two: %s\\n\", aStruct.One, aStruct.Two)\r\n","created_at":"2016-01-30T19:08:14Z","updated_at":"2016-02-01T09:51:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"49c841a44ea51a1f589c08d866e25d61fd8dff69","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/robertkrimen/otto/pulls/158/commits","review_comments_url":"https://api.github.com/repos/robertkrimen/otto/pulls/158/comments","review_comment_url":"https://api.github.com/repos/robertkrimen/otto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/robertkrimen/otto/issues/158/comments","statuses_url":"https://api.github.com/repos/robertkrimen/otto/statuses/8de86048d79444d79c4c081649ae6ee11a9283ba","head":{"label":"rsdoiel:master","ref":"master","sha":"8de86048d79444d79c4c081649ae6ee11a9283ba","user":{"login":"rsdoiel","id":169021,"avatar_url":"https://avatars.githubusercontent.com/u/169021?v=3","gravatar_id":"","url":"https://api.github.com/users/rsdoiel","html_url":"https://github.com/rsdoiel","followers_url":"https://api.github.com/users/rsdoiel/followers","following_url":"https://api.github.com/users/rsdoiel/following{/other_user}","gists_url":"https://api.github.com/users/rsdoiel/gists{/gist_id}","starred_url":"https://api.github.com/users/rsdoiel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsdoiel/subscriptions","organizations_url":"https://api.github.com/users/rsdoiel/orgs","repos_url":"https://api.github.com/users/rsdoiel/repos","events_url":"https://api.github.com/users/rsdoiel/events{/privacy}","received_events_url":"https://api.github.com/users/rsdoiel/received_events","type":"User","site_admin":false},"repo":{"id":21512769,"name":"otto","full_name":"rsdoiel/otto","owner":{"login":"rsdoiel","id":169021,"avatar_url":"https://avatars.githubusercontent.com/u/169021?v=3","gravatar_id":"","url":"https://api.github.com/users/rsdoiel","html_url":"https://github.com/rsdoiel","followers_url":"https://api.github.com/users/rsdoiel/followers","following_url":"https://api.github.com/users/rsdoiel/following{/other_user}","gists_url":"https://api.github.com/users/rsdoiel/gists{/gist_id}","starred_url":"https://api.github.com/users/rsdoiel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsdoiel/subscriptions","organizations_url":"https://api.github.com/users/rsdoiel/orgs","repos_url":"https://api.github.com/users/rsdoiel/repos","events_url":"https://api.github.com/users/rsdoiel/events{/privacy}","received_events_url":"https://api.github.com/users/rsdoiel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rsdoiel/otto","description":"A JavaScript interpreter in Go (golang)","fork":true,"url":"https://api.github.com/repos/rsdoiel/otto","forks_url":"https://api.github.com/repos/rsdoiel/otto/forks","keys_url":"https://api.github.com/repos/rsdoiel/otto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rsdoiel/otto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rsdoiel/otto/teams","hooks_url":"https://api.github.com/repos/rsdoiel/otto/hooks","issue_events_url":"https://api.github.com/repos/rsdoiel/otto/issues/events{/number}","events_url":"https://api.github.com/repos/rsdoiel/otto/events","assignees_url":"https://api.github.com/repos/rsdoiel/otto/assignees{/user}","branches_url":"https://api.github.com/repos/rsdoiel/otto/branches{/branch}","tags_url":"https://api.github.com/repos/rsdoiel/otto/tags","blobs_url":"https://api.github.com/repos/rsdoiel/otto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rsdoiel/otto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rsdoiel/otto/git/refs{/sha}","trees_url":"https://api.github.com/repos/rsdoiel/otto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rsdoiel/otto/statuses/{sha}","languages_url":"https://api.github.com/repos/rsdoiel/otto/languages","stargazers_url":"https://api.github.com/repos/rsdoiel/otto/stargazers","contributors_url":"https://api.github.com/repos/rsdoiel/otto/contributors","subscribers_url":"https://api.github.com/repos/rsdoiel/otto/subscribers","subscription_url":"https://api.github.com/repos/rsdoiel/otto/subscription","commits_url":"https://api.github.com/repos/rsdoiel/otto/commits{/sha}","git_commits_url":"https://api.github.com/repos/rsdoiel/otto/git/commits{/sha}","comments_url":"https://api.github.com/repos/rsdoiel/otto/comments{/number}","issue_comment_url":"https://api.github.com/repos/rsdoiel/otto/issues/comments{/number}","contents_url":"https://api.github.com/repos/rsdoiel/otto/contents/{+path}","compare_url":"https://api.github.com/repos/rsdoiel/otto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rsdoiel/otto/merges","archive_url":"https://api.github.com/repos/rsdoiel/otto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rsdoiel/otto/downloads","issues_url":"https://api.github.com/repos/rsdoiel/otto/issues{/number}","pulls_url":"https://api.github.com/repos/rsdoiel/otto/pulls{/number}","milestones_url":"https://api.github.com/repos/rsdoiel/otto/milestones{/number}","notifications_url":"https://api.github.com/repos/rsdoiel/otto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rsdoiel/otto/labels{/name}","releases_url":"https://api.github.com/repos/rsdoiel/otto/releases{/id}","deployments_url":"https://api.github.com/repos/rsdoiel/otto/deployments","created_at":"2014-07-05T03:50:02Z","updated_at":"2016-01-30T18:47:25Z","pushed_at":"2016-01-30T19:03:57Z","git_url":"git://github.com/rsdoiel/otto.git","ssh_url":"git@github.com:rsdoiel/otto.git","clone_url":"https://github.com/rsdoiel/otto.git","svn_url":"https://github.com/rsdoiel/otto","homepage":"http://godoc.org/github.com/robertkrimen/otto","size":1604,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"robertkrimen:master","ref":"master","sha":"c21072f61b64b51ea58138ccacf0a85d54b9f07c","user":{"login":"robertkrimen","id":16290,"avatar_url":"https://avatars.githubusercontent.com/u/16290?v=3","gravatar_id":"","url":"https://api.github.com/users/robertkrimen","html_url":"https://github.com/robertkrimen","followers_url":"https://api.github.com/users/robertkrimen/followers","following_url":"https://api.github.com/users/robertkrimen/following{/other_user}","gists_url":"https://api.github.com/users/robertkrimen/gists{/gist_id}","starred_url":"https://api.github.com/users/robertkrimen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertkrimen/subscriptions","organizations_url":"https://api.github.com/users/robertkrimen/orgs","repos_url":"https://api.github.com/users/robertkrimen/repos","events_url":"https://api.github.com/users/robertkrimen/events{/privacy}","received_events_url":"https://api.github.com/users/robertkrimen/received_events","type":"User","site_admin":false},"repo":{"id":6098927,"name":"otto","full_name":"robertkrimen/otto","owner":{"login":"robertkrimen","id":16290,"avatar_url":"https://avatars.githubusercontent.com/u/16290?v=3","gravatar_id":"","url":"https://api.github.com/users/robertkrimen","html_url":"https://github.com/robertkrimen","followers_url":"https://api.github.com/users/robertkrimen/followers","following_url":"https://api.github.com/users/robertkrimen/following{/other_user}","gists_url":"https://api.github.com/users/robertkrimen/gists{/gist_id}","starred_url":"https://api.github.com/users/robertkrimen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertkrimen/subscriptions","organizations_url":"https://api.github.com/users/robertkrimen/orgs","repos_url":"https://api.github.com/users/robertkrimen/repos","events_url":"https://api.github.com/users/robertkrimen/events{/privacy}","received_events_url":"https://api.github.com/users/robertkrimen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robertkrimen/otto","description":"A JavaScript interpreter in Go (golang)","fork":false,"url":"https://api.github.com/repos/robertkrimen/otto","forks_url":"https://api.github.com/repos/robertkrimen/otto/forks","keys_url":"https://api.github.com/repos/robertkrimen/otto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robertkrimen/otto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robertkrimen/otto/teams","hooks_url":"https://api.github.com/repos/robertkrimen/otto/hooks","issue_events_url":"https://api.github.com/repos/robertkrimen/otto/issues/events{/number}","events_url":"https://api.github.com/repos/robertkrimen/otto/events","assignees_url":"https://api.github.com/repos/robertkrimen/otto/assignees{/user}","branches_url":"https://api.github.com/repos/robertkrimen/otto/branches{/branch}","tags_url":"https://api.github.com/repos/robertkrimen/otto/tags","blobs_url":"https://api.github.com/repos/robertkrimen/otto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robertkrimen/otto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robertkrimen/otto/git/refs{/sha}","trees_url":"https://api.github.com/repos/robertkrimen/otto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robertkrimen/otto/statuses/{sha}","languages_url":"https://api.github.com/repos/robertkrimen/otto/languages","stargazers_url":"https://api.github.com/repos/robertkrimen/otto/stargazers","contributors_url":"https://api.github.com/repos/robertkrimen/otto/contributors","subscribers_url":"https://api.github.com/repos/robertkrimen/otto/subscribers","subscription_url":"https://api.github.com/repos/robertkrimen/otto/subscription","commits_url":"https://api.github.com/repos/robertkrimen/otto/commits{/sha}","git_commits_url":"https://api.github.com/repos/robertkrimen/otto/git/commits{/sha}","comments_url":"https://api.github.com/repos/robertkrimen/otto/comments{/number}","issue_comment_url":"https://api.github.com/repos/robertkrimen/otto/issues/comments{/number}","contents_url":"https://api.github.com/repos/robertkrimen/otto/contents/{+path}","compare_url":"https://api.github.com/repos/robertkrimen/otto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robertkrimen/otto/merges","archive_url":"https://api.github.com/repos/robertkrimen/otto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robertkrimen/otto/downloads","issues_url":"https://api.github.com/repos/robertkrimen/otto/issues{/number}","pulls_url":"https://api.github.com/repos/robertkrimen/otto/pulls{/number}","milestones_url":"https://api.github.com/repos/robertkrimen/otto/milestones{/number}","notifications_url":"https://api.github.com/repos/robertkrimen/otto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robertkrimen/otto/labels{/name}","releases_url":"https://api.github.com/repos/robertkrimen/otto/releases{/id}","deployments_url":"https://api.github.com/repos/robertkrimen/otto/deployments","created_at":"2012-10-06T01:48:39Z","updated_at":"2016-01-31T15:30:36Z","pushed_at":"2016-01-30T19:08:15Z","git_url":"git://github.com/robertkrimen/otto.git","ssh_url":"git@github.com:robertkrimen/otto.git","clone_url":"https://github.com/robertkrimen/otto.git","svn_url":"https://github.com/robertkrimen/otto","homepage":"http://godoc.org/github.com/robertkrimen/otto","size":1828,"stargazers_count":1936,"watchers_count":1936,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"open_issues_count":41,"forks":157,"open_issues":41,"watchers":1936,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/robertkrimen/otto/pulls/158"},"html":{"href":"https://github.com/robertkrimen/otto/pull/158"},"issue":{"href":"https://api.github.com/repos/robertkrimen/otto/issues/158"},"comments":{"href":"https://api.github.com/repos/robertkrimen/otto/issues/158/comments"},"review_comments":{"href":"https://api.github.com/repos/robertkrimen/otto/pulls/158/comments"},"review_comment":{"href":"https://api.github.com/repos/robertkrimen/otto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/robertkrimen/otto/pulls/158/commits"},"statuses":{"href":"https://api.github.com/repos/robertkrimen/otto/statuses/8de86048d79444d79c4c081649ae6ee11a9283ba"}}}}