GitHub PullRequestEvent at 2014-07-20 10:24:24
Repository: gopencils
Actor: bndr
Payload: {"action":"closed","number":4,"pull_request":{"url":"https://api.github.com/repos/bndr/gopencils/pulls/4","id":18628480,"html_url":"https://github.com/bndr/gopencils/pull/4","diff_url":"https://github.com/bndr/gopencils/pull/4.diff","patch_url":"https://github.com/bndr/gopencils/pull/4.patch","issue_url":"https://api.github.com/repos/bndr/gopencils/issues/4","number":4,"state":"closed","title":"don't use ioutil.ReadAll","user":{"login":"cryptix","id":111202,"avatar_url":"https://avatars.githubusercontent.com/u/111202?","gravatar_id":"321681c1f58e0ad5f319c938eb4fe819","url":"https://api.github.com/users/cryptix","html_url":"https://github.com/cryptix","followers_url":"https://api.github.com/users/cryptix/followers","following_url":"https://api.github.com/users/cryptix/following{/other_user}","gists_url":"https://api.github.com/users/cryptix/gists{/gist_id}","starred_url":"https://api.github.com/users/cryptix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cryptix/subscriptions","organizations_url":"https://api.github.com/users/cryptix/orgs","repos_url":"https://api.github.com/users/cryptix/repos","events_url":"https://api.github.com/users/cryptix/events{/privacy}","received_events_url":"https://api.github.com/users/cryptix/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nthis rewrites the way the contents are read from the `resp.Body`. With `ioutil.ReadAll` you essentially throw the whole responses in memory and than consume it with `encoding/json`. With `json.NewDecoder`, the responses is consumed directly from the response so you don't have to download and allocate the whole thing in ram.\r\n\r\nPlus: you ignored the error from `ReadAll` before.","created_at":"2014-07-20T10:11:41Z","updated_at":"2014-07-20T10:24:24Z","closed_at":"2014-07-20T10:24:24Z","merged_at":"2014-07-20T10:24:24Z","merge_commit_sha":"22c79f9a1ce0d07c13a88036132871fb7e5ed7bc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bndr/gopencils/pulls/4/commits","review_comments_url":"https://api.github.com/repos/bndr/gopencils/pulls/4/comments","review_comment_url":"https://api.github.com/repos/bndr/gopencils/pulls/comments/{number}","comments_url":"https://api.github.com/repos/bndr/gopencils/issues/4/comments","statuses_url":"https://api.github.com/repos/bndr/gopencils/statuses/9b3df85d6a3c478dc6c8be322df587d8dda7d94a","head":{"label":"cryptix:master","ref":"master","sha":"9b3df85d6a3c478dc6c8be322df587d8dda7d94a","user":{"login":"cryptix","id":111202,"avatar_url":"https://avatars.githubusercontent.com/u/111202?","gravatar_id":"321681c1f58e0ad5f319c938eb4fe819","url":"https://api.github.com/users/cryptix","html_url":"https://github.com/cryptix","followers_url":"https://api.github.com/users/cryptix/followers","following_url":"https://api.github.com/users/cryptix/following{/other_user}","gists_url":"https://api.github.com/users/cryptix/gists{/gist_id}","starred_url":"https://api.github.com/users/cryptix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cryptix/subscriptions","organizations_url":"https://api.github.com/users/cryptix/orgs","repos_url":"https://api.github.com/users/cryptix/repos","events_url":"https://api.github.com/users/cryptix/events{/privacy}","received_events_url":"https://api.github.com/users/cryptix/received_events","type":"User","site_admin":false},"repo":{"id":22030538,"name":"gopencils","full_name":"cryptix/gopencils","owner":{"login":"cryptix","id":111202,"avatar_url":"https://avatars.githubusercontent.com/u/111202?","gravatar_id":"321681c1f58e0ad5f319c938eb4fe819","url":"https://api.github.com/users/cryptix","html_url":"https://github.com/cryptix","followers_url":"https://api.github.com/users/cryptix/followers","following_url":"https://api.github.com/users/cryptix/following{/other_user}","gists_url":"https://api.github.com/users/cryptix/gists{/gist_id}","starred_url":"https://api.github.com/users/cryptix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cryptix/subscriptions","organizations_url":"https://api.github.com/users/cryptix/orgs","repos_url":"https://api.github.com/users/cryptix/repos","events_url":"https://api.github.com/users/cryptix/events{/privacy}","received_events_url":"https://api.github.com/users/cryptix/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cryptix/gopencils","description":"Easily consume REST APIs with Go (golang)","fork":true,"url":"https://api.github.com/repos/cryptix/gopencils","forks_url":"https://api.github.com/repos/cryptix/gopencils/forks","keys_url":"https://api.github.com/repos/cryptix/gopencils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cryptix/gopencils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cryptix/gopencils/teams","hooks_url":"https://api.github.com/repos/cryptix/gopencils/hooks","issue_events_url":"https://api.github.com/repos/cryptix/gopencils/issues/events{/number}","events_url":"https://api.github.com/repos/cryptix/gopencils/events","assignees_url":"https://api.github.com/repos/cryptix/gopencils/assignees{/user}","branches_url":"https://api.github.com/repos/cryptix/gopencils/branches{/branch}","tags_url":"https://api.github.com/repos/cryptix/gopencils/tags","blobs_url":"https://api.github.com/repos/cryptix/gopencils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cryptix/gopencils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cryptix/gopencils/git/refs{/sha}","trees_url":"https://api.github.com/repos/cryptix/gopencils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cryptix/gopencils/statuses/{sha}","languages_url":"https://api.github.com/repos/cryptix/gopencils/languages","stargazers_url":"https://api.github.com/repos/cryptix/gopencils/stargazers","contributors_url":"https://api.github.com/repos/cryptix/gopencils/contributors","subscribers_url":"https://api.github.com/repos/cryptix/gopencils/subscribers","subscription_url":"https://api.github.com/repos/cryptix/gopencils/subscription","commits_url":"https://api.github.com/repos/cryptix/gopencils/commits{/sha}","git_commits_url":"https://api.github.com/repos/cryptix/gopencils/git/commits{/sha}","comments_url":"https://api.github.com/repos/cryptix/gopencils/comments{/number}","issue_comment_url":"https://api.github.com/repos/cryptix/gopencils/issues/comments/{number}","contents_url":"https://api.github.com/repos/cryptix/gopencils/contents/{+path}","compare_url":"https://api.github.com/repos/cryptix/gopencils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cryptix/gopencils/merges","archive_url":"https://api.github.com/repos/cryptix/gopencils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cryptix/gopencils/downloads","issues_url":"https://api.github.com/repos/cryptix/gopencils/issues{/number}","pulls_url":"https://api.github.com/repos/cryptix/gopencils/pulls{/number}","milestones_url":"https://api.github.com/repos/cryptix/gopencils/milestones{/number}","notifications_url":"https://api.github.com/repos/cryptix/gopencils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cryptix/gopencils/labels{/name}","releases_url":"https://api.github.com/repos/cryptix/gopencils/releases{/id}","created_at":"2014-07-20T10:01:57Z","updated_at":"2014-07-20T10:06:06Z","pushed_at":"2014-07-20T10:06:05Z","git_url":"git://github.com/cryptix/gopencils.git","ssh_url":"git@github.com:cryptix/gopencils.git","clone_url":"https://github.com/cryptix/gopencils.git","svn_url":"https://github.com/cryptix/gopencils","homepage":"","size":323,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bndr:master","ref":"master","sha":"a34cc07482effbbcb1ca10bcf02d1c6331d198ee","user":{"login":"bndr","id":1145456,"avatar_url":"https://avatars.githubusercontent.com/u/1145456?","gravatar_id":"8d05db0b0b8b74d5a0f93d0b1db22909","url":"https://api.github.com/users/bndr","html_url":"https://github.com/bndr","followers_url":"https://api.github.com/users/bndr/followers","following_url":"https://api.github.com/users/bndr/following{/other_user}","gists_url":"https://api.github.com/users/bndr/gists{/gist_id}","starred_url":"https://api.github.com/users/bndr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bndr/subscriptions","organizations_url":"https://api.github.com/users/bndr/orgs","repos_url":"https://api.github.com/users/bndr/repos","events_url":"https://api.github.com/users/bndr/events{/privacy}","received_events_url":"https://api.github.com/users/bndr/received_events","type":"User","site_admin":false},"repo":{"id":21124171,"name":"gopencils","full_name":"bndr/gopencils","owner":{"login":"bndr","id":1145456,"avatar_url":"https://avatars.githubusercontent.com/u/1145456?","gravatar_id":"8d05db0b0b8b74d5a0f93d0b1db22909","url":"https://api.github.com/users/bndr","html_url":"https://github.com/bndr","followers_url":"https://api.github.com/users/bndr/followers","following_url":"https://api.github.com/users/bndr/following{/other_user}","gists_url":"https://api.github.com/users/bndr/gists{/gist_id}","starred_url":"https://api.github.com/users/bndr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bndr/subscriptions","organizations_url":"https://api.github.com/users/bndr/orgs","repos_url":"https://api.github.com/users/bndr/repos","events_url":"https://api.github.com/users/bndr/events{/privacy}","received_events_url":"https://api.github.com/users/bndr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bndr/gopencils","description":"Easily consume REST APIs with Go (golang)","fork":false,"url":"https://api.github.com/repos/bndr/gopencils","forks_url":"https://api.github.com/repos/bndr/gopencils/forks","keys_url":"https://api.github.com/repos/bndr/gopencils/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bndr/gopencils/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bndr/gopencils/teams","hooks_url":"https://api.github.com/repos/bndr/gopencils/hooks","issue_events_url":"https://api.github.com/repos/bndr/gopencils/issues/events{/number}","events_url":"https://api.github.com/repos/bndr/gopencils/events","assignees_url":"https://api.github.com/repos/bndr/gopencils/assignees{/user}","branches_url":"https://api.github.com/repos/bndr/gopencils/branches{/branch}","tags_url":"https://api.github.com/repos/bndr/gopencils/tags","blobs_url":"https://api.github.com/repos/bndr/gopencils/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bndr/gopencils/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bndr/gopencils/git/refs{/sha}","trees_url":"https://api.github.com/repos/bndr/gopencils/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bndr/gopencils/statuses/{sha}","languages_url":"https://api.github.com/repos/bndr/gopencils/languages","stargazers_url":"https://api.github.com/repos/bndr/gopencils/stargazers","contributors_url":"https://api.github.com/repos/bndr/gopencils/contributors","subscribers_url":"https://api.github.com/repos/bndr/gopencils/subscribers","subscription_url":"https://api.github.com/repos/bndr/gopencils/subscription","commits_url":"https://api.github.com/repos/bndr/gopencils/commits{/sha}","git_commits_url":"https://api.github.com/repos/bndr/gopencils/git/commits{/sha}","comments_url":"https://api.github.com/repos/bndr/gopencils/comments{/number}","issue_comment_url":"https://api.github.com/repos/bndr/gopencils/issues/comments/{number}","contents_url":"https://api.github.com/repos/bndr/gopencils/contents/{+path}","compare_url":"https://api.github.com/repos/bndr/gopencils/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bndr/gopencils/merges","archive_url":"https://api.github.com/repos/bndr/gopencils/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bndr/gopencils/downloads","issues_url":"https://api.github.com/repos/bndr/gopencils/issues{/number}","pulls_url":"https://api.github.com/repos/bndr/gopencils/pulls{/number}","milestones_url":"https://api.github.com/repos/bndr/gopencils/milestones{/number}","notifications_url":"https://api.github.com/repos/bndr/gopencils/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bndr/gopencils/labels{/name}","releases_url":"https://api.github.com/repos/bndr/gopencils/releases{/id}","created_at":"2014-06-23T11:41:24Z","updated_at":"2014-07-17T17:51:30Z","pushed_at":"2014-07-20T10:24:24Z","git_url":"git://github.com/bndr/gopencils.git","ssh_url":"git@github.com:bndr/gopencils.git","clone_url":"https://github.com/bndr/gopencils.git","svn_url":"https://github.com/bndr/gopencils","homepage":"","size":323,"stargazers_count":230,"watchers_count":230,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":10,"mirror_url":null,"open_issues_count":1,"forks":10,"open_issues":1,"watchers":230,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bndr/gopencils/pulls/4"},"html":{"href":"https://github.com/bndr/gopencils/pull/4"},"issue":{"href":"https://api.github.com/repos/bndr/gopencils/issues/4"},"comments":{"href":"https://api.github.com/repos/bndr/gopencils/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/bndr/gopencils/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/bndr/gopencils/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/bndr/gopencils/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/bndr/gopencils/statuses/9b3df85d6a3c478dc6c8be322df587d8dda7d94a"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"bndr","id":1145456,"avatar_url":"https://avatars.githubusercontent.com/u/1145456?","gravatar_id":"8d05db0b0b8b74d5a0f93d0b1db22909","url":"https://api.github.com/users/bndr","html_url":"https://github.com/bndr","followers_url":"https://api.github.com/users/bndr/followers","following_url":"https://api.github.com/users/bndr/following{/other_user}","gists_url":"https://api.github.com/users/bndr/gists{/gist_id}","starred_url":"https://api.github.com/users/bndr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bndr/subscriptions","organizations_url":"https://api.github.com/users/bndr/orgs","repos_url":"https://api.github.com/users/bndr/repos","events_url":"https://api.github.com/users/bndr/events{/privacy}","received_events_url":"https://api.github.com/users/bndr/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":3,"changed_files":1}}