{"action":"created","comment":{"url":"https://api.github.com/repos/mesos/mesos-go/pulls/comments/42203101","id":42203101,"diff_hunk":"@@ -44,6 +44,21 @@ var (\n \terrNotStarted      = errors.New(\"HTTP transport has not been started\")\n \terrTerminal        = errors.New(\"HTTP transport is terminated\")\n \terrAlreadyRunning  = errors.New(\"HTTP transport is already running\")\n+\n+\thttpTransport, httpClient = func() (tr *http.Transport, cl *http.Client) {","path":"messenger/http_transporter.go","position":5,"original_position":5,"commit_id":"5e1fd9d18c28523728549bb096c757c6fea0d714","original_commit_id":"5e1fd9d18c28523728549bb096c757c6fea0d714","user":{"login":"jdef","id":2348332,"avatar_url":"https://avatars.githubusercontent.com/u/2348332?v=3","gravatar_id":"","url":"https://api.github.com/users/jdef","html_url":"https://github.com/jdef","followers_url":"https://api.github.com/users/jdef/followers","following_url":"https://api.github.com/users/jdef/following{/other_user}","gists_url":"https://api.github.com/users/jdef/gists{/gist_id}","starred_url":"https://api.github.com/users/jdef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdef/subscriptions","organizations_url":"https://api.github.com/users/jdef/orgs","repos_url":"https://api.github.com/users/jdef/repos","events_url":"https://api.github.com/users/jdef/events{/privacy}","received_events_url":"https://api.github.com/users/jdef/received_events","type":"User","site_admin":false},"body":"Because I'm assigning both vars at the same time, client depends on\ntransport. Given that assignments are guaranteed to be carried out in\nleft-to-right order (just learned something new) I guess I don't need the\nfunc.\n\nOn Thu, Oct 15, 2015 at 8:42 PM, Karl Isenberg <notifications@github.com>\nwrote:\n\n> In messenger/http_transporter.go\n> <https://github.com/mesos/mesos-go/pull/198#discussion_r42198909>:\n>\n> > @@ -44,6 +44,21 @@ var (\n> >  \terrNotStarted      = errors.New(\"HTTP transport has not been started\")\n> >  \terrTerminal        = errors.New(\"HTTP transport is terminated\")\n> >  \terrAlreadyRunning  = errors.New(\"HTTP transport is already running\")\n> > +\n> > +\thttpTransport, httpClient = func() (tr *http.Transport, cl *http.Client) {\n>\n> why is this done in a function instead of just in a var definition?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/mesos/mesos-go/pull/198/files#r42198909>.\n>\n","created_at":"2015-10-16T02:14:28Z","updated_at":"2015-10-16T02:14:28Z","html_url":"https://github.com/mesos/mesos-go/pull/198#discussion_r42203101","pull_request_url":"https://api.github.com/repos/mesos/mesos-go/pulls/198","_links":{"self":{"href":"https://api.github.com/repos/mesos/mesos-go/pulls/comments/42203101"},"html":{"href":"https://github.com/mesos/mesos-go/pull/198#discussion_r42203101"},"pull_request":{"href":"https://api.github.com/repos/mesos/mesos-go/pulls/198"}}},"pull_request":{"url":"https://api.github.com/repos/mesos/mesos-go/pulls/198","id":47842639,"html_url":"https://github.com/mesos/mesos-go/pull/198","diff_url":"https://github.com/mesos/mesos-go/pull/198.diff","patch_url":"https://github.com/mesos/mesos-go/pull/198.patch","issue_url":"https://api.github.com/repos/mesos/mesos-go/issues/198","number":198,"state":"open","locked":false,"title":"be more explicit about timeouts and connection closure","user":{"login":"jdef","id":2348332,"avatar_url":"https://avatars.githubusercontent.com/u/2348332?v=3","gravatar_id":"","url":"https://api.github.com/users/jdef","html_url":"https://github.com/jdef","followers_url":"https://api.github.com/users/jdef/followers","following_url":"https://api.github.com/users/jdef/following{/other_user}","gists_url":"https://api.github.com/users/jdef/gists{/gist_id}","starred_url":"https://api.github.com/users/jdef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdef/subscriptions","organizations_url":"https://api.github.com/users/jdef/orgs","repos_url":"https://api.github.com/users/jdef/repos","events_url":"https://api.github.com/users/jdef/events{/privacy}","received_events_url":"https://api.github.com/users/jdef/received_events","type":"User","site_admin":false},"body":"* avoid possible racy reference to `d.con`, only close it if it was ever valid\r\n* flushing response buffers should eventually time out\r\n* specify read timeout for initial http client\r\n* be explicit about timeouts for dialed connections\r\n","created_at":"2015-10-15T21:13:49Z","updated_at":"2015-10-16T02:14:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"47d354cdf9be6bdb7302d2f112b6955cfdccb7ea","assignee":{"login":"sttts","id":730123,"avatar_url":"https://avatars.githubusercontent.com/u/730123?v=3","gravatar_id":"","url":"https://api.github.com/users/sttts","html_url":"https://github.com/sttts","followers_url":"https://api.github.com/users/sttts/followers","following_url":"https://api.github.com/users/sttts/following{/other_user}","gists_url":"https://api.github.com/users/sttts/gists{/gist_id}","starred_url":"https://api.github.com/users/sttts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sttts/subscriptions","organizations_url":"https://api.github.com/users/sttts/orgs","repos_url":"https://api.github.com/users/sttts/repos","events_url":"https://api.github.com/users/sttts/events{/privacy}","received_events_url":"https://api.github.com/users/sttts/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mesos/mesos-go/pulls/198/commits","review_comments_url":"https://api.github.com/repos/mesos/mesos-go/pulls/198/comments","review_comment_url":"https://api.github.com/repos/mesos/mesos-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesos/mesos-go/issues/198/comments","statuses_url":"https://api.github.com/repos/mesos/mesos-go/statuses/5e1fd9d18c28523728549bb096c757c6fea0d714","head":{"label":"mesos:jdef-fix-libprocess-wonkiness","ref":"jdef-fix-libprocess-wonkiness","sha":"5e1fd9d18c28523728549bb096c757c6fea0d714","user":{"login":"mesos","id":229272,"avatar_url":"https://avatars.githubusercontent.com/u/229272?v=3","gravatar_id":"","url":"https://api.github.com/users/mesos","html_url":"https://github.com/mesos","followers_url":"https://api.github.com/users/mesos/followers","following_url":"https://api.github.com/users/mesos/following{/other_user}","gists_url":"https://api.github.com/users/mesos/gists{/gist_id}","starred_url":"https://api.github.com/users/mesos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesos/subscriptions","organizations_url":"https://api.github.com/users/mesos/orgs","repos_url":"https://api.github.com/users/mesos/repos","events_url":"https://api.github.com/users/mesos/events{/privacy}","received_events_url":"https://api.github.com/users/mesos/received_events","type":"Organization","site_admin":false},"repo":{"id":14454411,"name":"mesos-go","full_name":"mesos/mesos-go","owner":{"login":"mesos","id":229272,"avatar_url":"https://avatars.githubusercontent.com/u/229272?v=3","gravatar_id":"","url":"https://api.github.com/users/mesos","html_url":"https://github.com/mesos","followers_url":"https://api.github.com/users/mesos/followers","following_url":"https://api.github.com/users/mesos/following{/other_user}","gists_url":"https://api.github.com/users/mesos/gists{/gist_id}","starred_url":"https://api.github.com/users/mesos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesos/subscriptions","organizations_url":"https://api.github.com/users/mesos/orgs","repos_url":"https://api.github.com/users/mesos/repos","events_url":"https://api.github.com/users/mesos/events{/privacy}","received_events_url":"https://api.github.com/users/mesos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesos/mesos-go","description":"Go language bindings for Apache Mesos","fork":false,"url":"https://api.github.com/repos/mesos/mesos-go","forks_url":"https://api.github.com/repos/mesos/mesos-go/forks","keys_url":"https://api.github.com/repos/mesos/mesos-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesos/mesos-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesos/mesos-go/teams","hooks_url":"https://api.github.com/repos/mesos/mesos-go/hooks","issue_events_url":"https://api.github.com/repos/mesos/mesos-go/issues/events{/number}","events_url":"https://api.github.com/repos/mesos/mesos-go/events","assignees_url":"https://api.github.com/repos/mesos/mesos-go/assignees{/user}","branches_url":"https://api.github.com/repos/mesos/mesos-go/branches{/branch}","tags_url":"https://api.github.com/repos/mesos/mesos-go/tags","blobs_url":"https://api.github.com/repos/mesos/mesos-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesos/mesos-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesos/mesos-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesos/mesos-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesos/mesos-go/statuses/{sha}","languages_url":"https://api.github.com/repos/mesos/mesos-go/languages","stargazers_url":"https://api.github.com/repos/mesos/mesos-go/stargazers","contributors_url":"https://api.github.com/repos/mesos/mesos-go/contributors","subscribers_url":"https://api.github.com/repos/mesos/mesos-go/subscribers","subscription_url":"https://api.github.com/repos/mesos/mesos-go/subscription","commits_url":"https://api.github.com/repos/mesos/mesos-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesos/mesos-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesos/mesos-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesos/mesos-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesos/mesos-go/contents/{+path}","compare_url":"https://api.github.com/repos/mesos/mesos-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesos/mesos-go/merges","archive_url":"https://api.github.com/repos/mesos/mesos-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesos/mesos-go/downloads","issues_url":"https://api.github.com/repos/mesos/mesos-go/issues{/number}","pulls_url":"https://api.github.com/repos/mesos/mesos-go/pulls{/number}","milestones_url":"https://api.github.com/repos/mesos/mesos-go/milestones{/number}","notifications_url":"https://api.github.com/repos/mesos/mesos-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesos/mesos-go/labels{/name}","releases_url":"https://api.github.com/repos/mesos/mesos-go/releases{/id}","created_at":"2013-11-16T20:40:30Z","updated_at":"2015-10-12T08:07:01Z","pushed_at":"2015-10-15T21:13:50Z","git_url":"git://github.com/mesos/mesos-go.git","ssh_url":"git@github.com:mesos/mesos-go.git","clone_url":"https://github.com/mesos/mesos-go.git","svn_url":"https://github.com/mesos/mesos-go","homepage":"","size":10985,"stargazers_count":256,"watchers_count":256,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"open_issues_count":25,"forks":64,"open_issues":25,"watchers":256,"default_branch":"master"}},"base":{"label":"mesos:master","ref":"master","sha":"aaa5b2fecf0e2db463f4f996c89617d6766b2969","user":{"login":"mesos","id":229272,"avatar_url":"https://avatars.githubusercontent.com/u/229272?v=3","gravatar_id":"","url":"https://api.github.com/users/mesos","html_url":"https://github.com/mesos","followers_url":"https://api.github.com/users/mesos/followers","following_url":"https://api.github.com/users/mesos/following{/other_user}","gists_url":"https://api.github.com/users/mesos/gists{/gist_id}","starred_url":"https://api.github.com/users/mesos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesos/subscriptions","organizations_url":"https://api.github.com/users/mesos/orgs","repos_url":"https://api.github.com/users/mesos/repos","events_url":"https://api.github.com/users/mesos/events{/privacy}","received_events_url":"https://api.github.com/users/mesos/received_events","type":"Organization","site_admin":false},"repo":{"id":14454411,"name":"mesos-go","full_name":"mesos/mesos-go","owner":{"login":"mesos","id":229272,"avatar_url":"https://avatars.githubusercontent.com/u/229272?v=3","gravatar_id":"","url":"https://api.github.com/users/mesos","html_url":"https://github.com/mesos","followers_url":"https://api.github.com/users/mesos/followers","following_url":"https://api.github.com/users/mesos/following{/other_user}","gists_url":"https://api.github.com/users/mesos/gists{/gist_id}","starred_url":"https://api.github.com/users/mesos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesos/subscriptions","organizations_url":"https://api.github.com/users/mesos/orgs","repos_url":"https://api.github.com/users/mesos/repos","events_url":"https://api.github.com/users/mesos/events{/privacy}","received_events_url":"https://api.github.com/users/mesos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesos/mesos-go","description":"Go language bindings for Apache Mesos","fork":false,"url":"https://api.github.com/repos/mesos/mesos-go","forks_url":"https://api.github.com/repos/mesos/mesos-go/forks","keys_url":"https://api.github.com/repos/mesos/mesos-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesos/mesos-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesos/mesos-go/teams","hooks_url":"https://api.github.com/repos/mesos/mesos-go/hooks","issue_events_url":"https://api.github.com/repos/mesos/mesos-go/issues/events{/number}","events_url":"https://api.github.com/repos/mesos/mesos-go/events","assignees_url":"https://api.github.com/repos/mesos/mesos-go/assignees{/user}","branches_url":"https://api.github.com/repos/mesos/mesos-go/branches{/branch}","tags_url":"https://api.github.com/repos/mesos/mesos-go/tags","blobs_url":"https://api.github.com/repos/mesos/mesos-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesos/mesos-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesos/mesos-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesos/mesos-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesos/mesos-go/statuses/{sha}","languages_url":"https://api.github.com/repos/mesos/mesos-go/languages","stargazers_url":"https://api.github.com/repos/mesos/mesos-go/stargazers","contributors_url":"https://api.github.com/repos/mesos/mesos-go/contributors","subscribers_url":"https://api.github.com/repos/mesos/mesos-go/subscribers","subscription_url":"https://api.github.com/repos/mesos/mesos-go/subscription","commits_url":"https://api.github.com/repos/mesos/mesos-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesos/mesos-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesos/mesos-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesos/mesos-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesos/mesos-go/contents/{+path}","compare_url":"https://api.github.com/repos/mesos/mesos-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesos/mesos-go/merges","archive_url":"https://api.github.com/repos/mesos/mesos-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesos/mesos-go/downloads","issues_url":"https://api.github.com/repos/mesos/mesos-go/issues{/number}","pulls_url":"https://api.github.com/repos/mesos/mesos-go/pulls{/number}","milestones_url":"https://api.github.com/repos/mesos/mesos-go/milestones{/number}","notifications_url":"https://api.github.com/repos/mesos/mesos-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesos/mesos-go/labels{/name}","releases_url":"https://api.github.com/repos/mesos/mesos-go/releases{/id}","created_at":"2013-11-16T20:40:30Z","updated_at":"2015-10-12T08:07:01Z","pushed_at":"2015-10-15T21:13:50Z","git_url":"git://github.com/mesos/mesos-go.git","ssh_url":"git@github.com:mesos/mesos-go.git","clone_url":"https://github.com/mesos/mesos-go.git","svn_url":"https://github.com/mesos/mesos-go","homepage":"","size":10985,"stargazers_count":256,"watchers_count":256,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"open_issues_count":25,"forks":64,"open_issues":25,"watchers":256,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesos/mesos-go/pulls/198"},"html":{"href":"https://github.com/mesos/mesos-go/pull/198"},"issue":{"href":"https://api.github.com/repos/mesos/mesos-go/issues/198"},"comments":{"href":"https://api.github.com/repos/mesos/mesos-go/issues/198/comments"},"review_comments":{"href":"https://api.github.com/repos/mesos/mesos-go/pulls/198/comments"},"review_comment":{"href":"https://api.github.com/repos/mesos/mesos-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesos/mesos-go/pulls/198/commits"},"statuses":{"href":"https://api.github.com/repos/mesos/mesos-go/statuses/5e1fd9d18c28523728549bb096c757c6fea0d714"}}}}