{"action":"created","comment":{"url":"https://api.github.com/repos/cloudwan/gohan/pulls/comments/174420538","pull_request_review_id":103748991,"id":174420538,"diff_hunk":"@@ -355,3 +356,20 @@ func Index(slice []string, elem string) int {\n \t}\n \treturn -1\n }\n+\n+//ReadJSON reads JSON from http request\n+func ReadJSON(r *http.Request) (map[string]interface{}, error) {\n+\tvar data interface{}\n+\tvar reqData bytes.Buffer\n+\ttee := io.TeeReader(r.Body, &reqData)\n+\tdecoder := json.NewDecoder(tee)\n+\tr.Body = ioutil.NopCloser(&reqData)","path":"util/util.go","position":19,"original_position":19,"commit_id":"50345e7266f42d46ddc52e81af0fb45c1893b762","original_commit_id":"50345e7266f42d46ddc52e81af0fb45c1893b762","user":{"login":"p-kozlowski","id":6004891,"avatar_url":"https://avatars1.githubusercontent.com/u/6004891?v=4","gravatar_id":"","url":"https://api.github.com/users/p-kozlowski","html_url":"https://github.com/p-kozlowski","followers_url":"https://api.github.com/users/p-kozlowski/followers","following_url":"https://api.github.com/users/p-kozlowski/following{/other_user}","gists_url":"https://api.github.com/users/p-kozlowski/gists{/gist_id}","starred_url":"https://api.github.com/users/p-kozlowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/p-kozlowski/subscriptions","organizations_url":"https://api.github.com/users/p-kozlowski/orgs","repos_url":"https://api.github.com/users/p-kozlowski/repos","events_url":"https://api.github.com/users/p-kozlowski/events{/privacy}","received_events_url":"https://api.github.com/users/p-kozlowski/received_events","type":"User","site_admin":false},"body":"looks fishy: we're modifying the requests internal state in a utility function. instead I'd rather store (a copy of) the `Body` in the `context`. as a result you wouldn't need to provide `GetHttpRequestBody` in `goext`","created_at":"2018-03-14T10:56:50Z","updated_at":"2018-03-14T10:58:19Z","html_url":"https://github.com/cloudwan/gohan/pull/626#discussion_r174420538","pull_request_url":"https://api.github.com/repos/cloudwan/gohan/pulls/626","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/cloudwan/gohan/pulls/comments/174420538"},"html":{"href":"https://github.com/cloudwan/gohan/pull/626#discussion_r174420538"},"pull_request":{"href":"https://api.github.com/repos/cloudwan/gohan/pulls/626"}}},"pull_request":{"url":"https://api.github.com/repos/cloudwan/gohan/pulls/626","id":174816951,"html_url":"https://github.com/cloudwan/gohan/pull/626","diff_url":"https://github.com/cloudwan/gohan/pull/626.diff","patch_url":"https://github.com/cloudwan/gohan/pull/626.patch","issue_url":"https://api.github.com/repos/cloudwan/gohan/issues/626","number":626,"state":"open","locked":false,"title":"Extracted GetHttpRequestBody to goplugin::Util","user":{"login":"zimnx","id":3951334,"avatar_url":"https://avatars2.githubusercontent.com/u/3951334?v=4","gravatar_id":"","url":"https://api.github.com/users/zimnx","html_url":"https://github.com/zimnx","followers_url":"https://api.github.com/users/zimnx/followers","following_url":"https://api.github.com/users/zimnx/following{/other_user}","gists_url":"https://api.github.com/users/zimnx/gists{/gist_id}","starred_url":"https://api.github.com/users/zimnx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zimnx/subscriptions","organizations_url":"https://api.github.com/users/zimnx/orgs","repos_url":"https://api.github.com/users/zimnx/repos","events_url":"https://api.github.com/users/zimnx/events{/privacy}","received_events_url":"https://api.github.com/users/zimnx/received_events","type":"User","site_admin":false},"body":"Also changed ReadJSON method to not consume request body.\r\nDuplicated buffer will be stored under request to allow multiple reads from it","created_at":"2018-03-13T23:24:43Z","updated_at":"2018-03-14T10:58:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be15304c78afe03b7e6fccab35d70320daa15d1f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"marcin-ptaszynski","id":129948,"avatar_url":"https://avatars0.githubusercontent.com/u/129948?v=4","gravatar_id":"","url":"https://api.github.com/users/marcin-ptaszynski","html_url":"https://github.com/marcin-ptaszynski","followers_url":"https://api.github.com/users/marcin-ptaszynski/followers","following_url":"https://api.github.com/users/marcin-ptaszynski/following{/other_user}","gists_url":"https://api.github.com/users/marcin-ptaszynski/gists{/gist_id}","starred_url":"https://api.github.com/users/marcin-ptaszynski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcin-ptaszynski/subscriptions","organizations_url":"https://api.github.com/users/marcin-ptaszynski/orgs","repos_url":"https://api.github.com/users/marcin-ptaszynski/repos","events_url":"https://api.github.com/users/marcin-ptaszynski/events{/privacy}","received_events_url":"https://api.github.com/users/marcin-ptaszynski/received_events","type":"User","site_admin":false},{"login":"jkmar","id":18344498,"avatar_url":"https://avatars1.githubusercontent.com/u/18344498?v=4","gravatar_id":"","url":"https://api.github.com/users/jkmar","html_url":"https://github.com/jkmar","followers_url":"https://api.github.com/users/jkmar/followers","following_url":"https://api.github.com/users/jkmar/following{/other_user}","gists_url":"https://api.github.com/users/jkmar/gists{/gist_id}","starred_url":"https://api.github.com/users/jkmar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkmar/subscriptions","organizations_url":"https://api.github.com/users/jkmar/orgs","repos_url":"https://api.github.com/users/jkmar/repos","events_url":"https://api.github.com/users/jkmar/events{/privacy}","received_events_url":"https://api.github.com/users/jkmar/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cloudwan/gohan/pulls/626/commits","review_comments_url":"https://api.github.com/repos/cloudwan/gohan/pulls/626/comments","review_comment_url":"https://api.github.com/repos/cloudwan/gohan/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudwan/gohan/issues/626/comments","statuses_url":"https://api.github.com/repos/cloudwan/gohan/statuses/50345e7266f42d46ddc52e81af0fb45c1893b762","head":{"label":"zimnx:extract-read-json","ref":"extract-read-json","sha":"50345e7266f42d46ddc52e81af0fb45c1893b762","user":{"login":"zimnx","id":3951334,"avatar_url":"https://avatars2.githubusercontent.com/u/3951334?v=4","gravatar_id":"","url":"https://api.github.com/users/zimnx","html_url":"https://github.com/zimnx","followers_url":"https://api.github.com/users/zimnx/followers","following_url":"https://api.github.com/users/zimnx/following{/other_user}","gists_url":"https://api.github.com/users/zimnx/gists{/gist_id}","starred_url":"https://api.github.com/users/zimnx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zimnx/subscriptions","organizations_url":"https://api.github.com/users/zimnx/orgs","repos_url":"https://api.github.com/users/zimnx/repos","events_url":"https://api.github.com/users/zimnx/events{/privacy}","received_events_url":"https://api.github.com/users/zimnx/received_events","type":"User","site_admin":false},"repo":{"id":72859429,"name":"gohan","full_name":"zimnx/gohan","owner":{"login":"zimnx","id":3951334,"avatar_url":"https://avatars2.githubusercontent.com/u/3951334?v=4","gravatar_id":"","url":"https://api.github.com/users/zimnx","html_url":"https://github.com/zimnx","followers_url":"https://api.github.com/users/zimnx/followers","following_url":"https://api.github.com/users/zimnx/following{/other_user}","gists_url":"https://api.github.com/users/zimnx/gists{/gist_id}","starred_url":"https://api.github.com/users/zimnx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zimnx/subscriptions","organizations_url":"https://api.github.com/users/zimnx/orgs","repos_url":"https://api.github.com/users/zimnx/repos","events_url":"https://api.github.com/users/zimnx/events{/privacy}","received_events_url":"https://api.github.com/users/zimnx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zimnx/gohan","description":"Gohan is an API Gateway Server written by Go that makes it easy for developers to create and maintain REST-style API","fork":true,"url":"https://api.github.com/repos/zimnx/gohan","forks_url":"https://api.github.com/repos/zimnx/gohan/forks","keys_url":"https://api.github.com/repos/zimnx/gohan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zimnx/gohan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zimnx/gohan/teams","hooks_url":"https://api.github.com/repos/zimnx/gohan/hooks","issue_events_url":"https://api.github.com/repos/zimnx/gohan/issues/events{/number}","events_url":"https://api.github.com/repos/zimnx/gohan/events","assignees_url":"https://api.github.com/repos/zimnx/gohan/assignees{/user}","branches_url":"https://api.github.com/repos/zimnx/gohan/branches{/branch}","tags_url":"https://api.github.com/repos/zimnx/gohan/tags","blobs_url":"https://api.github.com/repos/zimnx/gohan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zimnx/gohan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zimnx/gohan/git/refs{/sha}","trees_url":"https://api.github.com/repos/zimnx/gohan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zimnx/gohan/statuses/{sha}","languages_url":"https://api.github.com/repos/zimnx/gohan/languages","stargazers_url":"https://api.github.com/repos/zimnx/gohan/stargazers","contributors_url":"https://api.github.com/repos/zimnx/gohan/contributors","subscribers_url":"https://api.github.com/repos/zimnx/gohan/subscribers","subscription_url":"https://api.github.com/repos/zimnx/gohan/subscription","commits_url":"https://api.github.com/repos/zimnx/gohan/commits{/sha}","git_commits_url":"https://api.github.com/repos/zimnx/gohan/git/commits{/sha}","comments_url":"https://api.github.com/repos/zimnx/gohan/comments{/number}","issue_comment_url":"https://api.github.com/repos/zimnx/gohan/issues/comments{/number}","contents_url":"https://api.github.com/repos/zimnx/gohan/contents/{+path}","compare_url":"https://api.github.com/repos/zimnx/gohan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zimnx/gohan/merges","archive_url":"https://api.github.com/repos/zimnx/gohan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zimnx/gohan/downloads","issues_url":"https://api.github.com/repos/zimnx/gohan/issues{/number}","pulls_url":"https://api.github.com/repos/zimnx/gohan/pulls{/number}","milestones_url":"https://api.github.com/repos/zimnx/gohan/milestones{/number}","notifications_url":"https://api.github.com/repos/zimnx/gohan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zimnx/gohan/labels{/name}","releases_url":"https://api.github.com/repos/zimnx/gohan/releases{/id}","deployments_url":"https://api.github.com/repos/zimnx/gohan/deployments","created_at":"2016-11-04T15:19:36Z","updated_at":"2016-11-04T15:19:37Z","pushed_at":"2018-03-13T23:25:11Z","git_url":"git://github.com/zimnx/gohan.git","ssh_url":"git@github.com:zimnx/gohan.git","clone_url":"https://github.com/zimnx/gohan.git","svn_url":"https://github.com/zimnx/gohan","homepage":"http://www.slideshare.net/natiueno/gohan-61170476","size":33288,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cloudwan:master","ref":"master","sha":"004915f6525cec7704d94b5b2cddbd1f4ba12c78","user":{"login":"cloudwan","id":13223939,"avatar_url":"https://avatars2.githubusercontent.com/u/13223939?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudwan","html_url":"https://github.com/cloudwan","followers_url":"https://api.github.com/users/cloudwan/followers","following_url":"https://api.github.com/users/cloudwan/following{/other_user}","gists_url":"https://api.github.com/users/cloudwan/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudwan/subscriptions","organizations_url":"https://api.github.com/users/cloudwan/orgs","repos_url":"https://api.github.com/users/cloudwan/repos","events_url":"https://api.github.com/users/cloudwan/events{/privacy}","received_events_url":"https://api.github.com/users/cloudwan/received_events","type":"Organization","site_admin":false},"repo":{"id":43838360,"name":"gohan","full_name":"cloudwan/gohan","owner":{"login":"cloudwan","id":13223939,"avatar_url":"https://avatars2.githubusercontent.com/u/13223939?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudwan","html_url":"https://github.com/cloudwan","followers_url":"https://api.github.com/users/cloudwan/followers","following_url":"https://api.github.com/users/cloudwan/following{/other_user}","gists_url":"https://api.github.com/users/cloudwan/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudwan/subscriptions","organizations_url":"https://api.github.com/users/cloudwan/orgs","repos_url":"https://api.github.com/users/cloudwan/repos","events_url":"https://api.github.com/users/cloudwan/events{/privacy}","received_events_url":"https://api.github.com/users/cloudwan/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudwan/gohan","description":"Gohan is an API Gateway Server written by Go that makes it easy for developers to create and maintain REST-style API","fork":false,"url":"https://api.github.com/repos/cloudwan/gohan","forks_url":"https://api.github.com/repos/cloudwan/gohan/forks","keys_url":"https://api.github.com/repos/cloudwan/gohan/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudwan/gohan/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudwan/gohan/teams","hooks_url":"https://api.github.com/repos/cloudwan/gohan/hooks","issue_events_url":"https://api.github.com/repos/cloudwan/gohan/issues/events{/number}","events_url":"https://api.github.com/repos/cloudwan/gohan/events","assignees_url":"https://api.github.com/repos/cloudwan/gohan/assignees{/user}","branches_url":"https://api.github.com/repos/cloudwan/gohan/branches{/branch}","tags_url":"https://api.github.com/repos/cloudwan/gohan/tags","blobs_url":"https://api.github.com/repos/cloudwan/gohan/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudwan/gohan/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudwan/gohan/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudwan/gohan/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudwan/gohan/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudwan/gohan/languages","stargazers_url":"https://api.github.com/repos/cloudwan/gohan/stargazers","contributors_url":"https://api.github.com/repos/cloudwan/gohan/contributors","subscribers_url":"https://api.github.com/repos/cloudwan/gohan/subscribers","subscription_url":"https://api.github.com/repos/cloudwan/gohan/subscription","commits_url":"https://api.github.com/repos/cloudwan/gohan/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudwan/gohan/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudwan/gohan/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudwan/gohan/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudwan/gohan/contents/{+path}","compare_url":"https://api.github.com/repos/cloudwan/gohan/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudwan/gohan/merges","archive_url":"https://api.github.com/repos/cloudwan/gohan/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudwan/gohan/downloads","issues_url":"https://api.github.com/repos/cloudwan/gohan/issues{/number}","pulls_url":"https://api.github.com/repos/cloudwan/gohan/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudwan/gohan/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudwan/gohan/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudwan/gohan/labels{/name}","releases_url":"https://api.github.com/repos/cloudwan/gohan/releases{/id}","deployments_url":"https://api.github.com/repos/cloudwan/gohan/deployments","created_at":"2015-10-07T19:01:47Z","updated_at":"2018-02-06T21:03:35Z","pushed_at":"2018-03-13T23:25:13Z","git_url":"git://github.com/cloudwan/gohan.git","ssh_url":"git@github.com:cloudwan/gohan.git","clone_url":"https://github.com/cloudwan/gohan.git","svn_url":"https://github.com/cloudwan/gohan","homepage":"http://www.slideshare.net/natiueno/gohan-61170476","size":33229,"stargazers_count":89,"watchers_count":89,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":45,"mirror_url":null,"archived":false,"open_issues_count":56,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":45,"open_issues":56,"watchers":89,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudwan/gohan/pulls/626"},"html":{"href":"https://github.com/cloudwan/gohan/pull/626"},"issue":{"href":"https://api.github.com/repos/cloudwan/gohan/issues/626"},"comments":{"href":"https://api.github.com/repos/cloudwan/gohan/issues/626/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudwan/gohan/pulls/626/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudwan/gohan/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudwan/gohan/pulls/626/commits"},"statuses":{"href":"https://api.github.com/repos/cloudwan/gohan/statuses/50345e7266f42d46ddc52e81af0fb45c1893b762"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"p-kozlowski"}}