{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/origin/pulls/comments/79319272","id":79319272,"diff_hunk":"@@ -157,7 +158,12 @@ func NewCmdRegistry(f *clientcmd.Factory, parentName, name string, out io.Writer\n \t\t\t\tConfig: cfg,\n \t\t\t}\n \t\t\tkcmdutil.CheckErr(opts.Complete(f, cmd, out, args))\n-\t\t\tkcmdutil.CheckErr(opts.RunCmdRegistry())\n+\t\t\terr := opts.RunCmdRegistry()\n+\t\t\tif err != cmdutil.ErrExit {","path":"pkg/cmd/admin/registry/registry.go","position":14,"original_position":14,"commit_id":"09ef7093d5037c06019642196896a65e2b81ec78","original_commit_id":"09ef7093d5037c06019642196896a65e2b81ec78","user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"body":"Generally we invert this:\r\n\r\n```\r\nif err == cmdutil.ErrExit {\r\n  os.Exit(1)\r\n}\r\nkcmdutil.CheckErr(err)\r\n```\r\n\r\nThat avoids the else block and simplifies the if so it is easier to read.","created_at":"2016-09-19T00:36:32Z","updated_at":"2016-09-19T00:36:35Z","html_url":"https://github.com/openshift/origin/pull/10883#discussion_r79319272","pull_request_url":"https://api.github.com/repos/openshift/origin/pulls/10883","_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments/79319272"},"html":{"href":"https://github.com/openshift/origin/pull/10883#discussion_r79319272"},"pull_request":{"href":"https://api.github.com/repos/openshift/origin/pulls/10883"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/origin/pulls/10883","id":84977552,"html_url":"https://github.com/openshift/origin/pull/10883","diff_url":"https://github.com/openshift/origin/pull/10883.diff","patch_url":"https://github.com/openshift/origin/pull/10883.patch","issue_url":"https://api.github.com/repos/openshift/origin/issues/10883","number":10883,"state":"open","locked":false,"title":"`Run` should be exit immediately if the return of `RunCmdRegistry()` is `cmdutil.ErrExit`.","user":{"login":"miaoyq","id":17755856,"avatar_url":"https://avatars.githubusercontent.com/u/17755856?v=3","gravatar_id":"","url":"https://api.github.com/users/miaoyq","html_url":"https://github.com/miaoyq","followers_url":"https://api.github.com/users/miaoyq/followers","following_url":"https://api.github.com/users/miaoyq/following{/other_user}","gists_url":"https://api.github.com/users/miaoyq/gists{/gist_id}","starred_url":"https://api.github.com/users/miaoyq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miaoyq/subscriptions","organizations_url":"https://api.github.com/users/miaoyq/orgs","repos_url":"https://api.github.com/users/miaoyq/repos","events_url":"https://api.github.com/users/miaoyq/events{/privacy}","received_events_url":"https://api.github.com/users/miaoyq/received_events","type":"User","site_admin":false},"body":"`Run` should exit immediately if the return of `RunCmdRegistry()` is `cmdutil.ErrExit`.","created_at":"2016-09-13T02:50:20Z","updated_at":"2016-09-19T00:36:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd0fc5ea1d22156823516dde5fab5801e0387acb","assignee":{"login":"mfojtik","id":44136,"avatar_url":"https://avatars.githubusercontent.com/u/44136?v=3","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false},"assignees":[{"login":"mfojtik","id":44136,"avatar_url":"https://avatars.githubusercontent.com/u/44136?v=3","gravatar_id":"","url":"https://api.github.com/users/mfojtik","html_url":"https://github.com/mfojtik","followers_url":"https://api.github.com/users/mfojtik/followers","following_url":"https://api.github.com/users/mfojtik/following{/other_user}","gists_url":"https://api.github.com/users/mfojtik/gists{/gist_id}","starred_url":"https://api.github.com/users/mfojtik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfojtik/subscriptions","organizations_url":"https://api.github.com/users/mfojtik/orgs","repos_url":"https://api.github.com/users/mfojtik/repos","events_url":"https://api.github.com/users/mfojtik/events{/privacy}","received_events_url":"https://api.github.com/users/mfojtik/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/openshift/origin/pulls/10883/commits","review_comments_url":"https://api.github.com/repos/openshift/origin/pulls/10883/comments","review_comment_url":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/origin/issues/10883/comments","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/09ef7093d5037c06019642196896a65e2b81ec78","head":{"label":"miaoyq:add-err-type-judgment","ref":"add-err-type-judgment","sha":"09ef7093d5037c06019642196896a65e2b81ec78","user":{"login":"miaoyq","id":17755856,"avatar_url":"https://avatars.githubusercontent.com/u/17755856?v=3","gravatar_id":"","url":"https://api.github.com/users/miaoyq","html_url":"https://github.com/miaoyq","followers_url":"https://api.github.com/users/miaoyq/followers","following_url":"https://api.github.com/users/miaoyq/following{/other_user}","gists_url":"https://api.github.com/users/miaoyq/gists{/gist_id}","starred_url":"https://api.github.com/users/miaoyq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miaoyq/subscriptions","organizations_url":"https://api.github.com/users/miaoyq/orgs","repos_url":"https://api.github.com/users/miaoyq/repos","events_url":"https://api.github.com/users/miaoyq/events{/privacy}","received_events_url":"https://api.github.com/users/miaoyq/received_events","type":"User","site_admin":false},"repo":{"id":63936439,"name":"origin","full_name":"miaoyq/origin","owner":{"login":"miaoyq","id":17755856,"avatar_url":"https://avatars.githubusercontent.com/u/17755856?v=3","gravatar_id":"","url":"https://api.github.com/users/miaoyq","html_url":"https://github.com/miaoyq","followers_url":"https://api.github.com/users/miaoyq/followers","following_url":"https://api.github.com/users/miaoyq/following{/other_user}","gists_url":"https://api.github.com/users/miaoyq/gists{/gist_id}","starred_url":"https://api.github.com/users/miaoyq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miaoyq/subscriptions","organizations_url":"https://api.github.com/users/miaoyq/orgs","repos_url":"https://api.github.com/users/miaoyq/repos","events_url":"https://api.github.com/users/miaoyq/events{/privacy}","received_events_url":"https://api.github.com/users/miaoyq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/miaoyq/origin","description":"Enterprise-Ready Kubernetes for Developers","fork":true,"url":"https://api.github.com/repos/miaoyq/origin","forks_url":"https://api.github.com/repos/miaoyq/origin/forks","keys_url":"https://api.github.com/repos/miaoyq/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/miaoyq/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/miaoyq/origin/teams","hooks_url":"https://api.github.com/repos/miaoyq/origin/hooks","issue_events_url":"https://api.github.com/repos/miaoyq/origin/issues/events{/number}","events_url":"https://api.github.com/repos/miaoyq/origin/events","assignees_url":"https://api.github.com/repos/miaoyq/origin/assignees{/user}","branches_url":"https://api.github.com/repos/miaoyq/origin/branches{/branch}","tags_url":"https://api.github.com/repos/miaoyq/origin/tags","blobs_url":"https://api.github.com/repos/miaoyq/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/miaoyq/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/miaoyq/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/miaoyq/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/miaoyq/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/miaoyq/origin/languages","stargazers_url":"https://api.github.com/repos/miaoyq/origin/stargazers","contributors_url":"https://api.github.com/repos/miaoyq/origin/contributors","subscribers_url":"https://api.github.com/repos/miaoyq/origin/subscribers","subscription_url":"https://api.github.com/repos/miaoyq/origin/subscription","commits_url":"https://api.github.com/repos/miaoyq/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/miaoyq/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/miaoyq/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/miaoyq/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/miaoyq/origin/contents/{+path}","compare_url":"https://api.github.com/repos/miaoyq/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/miaoyq/origin/merges","archive_url":"https://api.github.com/repos/miaoyq/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/miaoyq/origin/downloads","issues_url":"https://api.github.com/repos/miaoyq/origin/issues{/number}","pulls_url":"https://api.github.com/repos/miaoyq/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/miaoyq/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/miaoyq/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/miaoyq/origin/labels{/name}","releases_url":"https://api.github.com/repos/miaoyq/origin/releases{/id}","deployments_url":"https://api.github.com/repos/miaoyq/origin/deployments","created_at":"2016-07-22T08:17:37Z","updated_at":"2016-07-22T08:17:46Z","pushed_at":"2016-09-17T03:59:09Z","git_url":"git://github.com/miaoyq/origin.git","ssh_url":"git@github.com:miaoyq/origin.git","clone_url":"https://github.com/miaoyq/origin.git","svn_url":"https://github.com/miaoyq/origin","homepage":"http://www.openshift.org","size":338157,"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":"openshift:master","ref":"master","sha":"3cd9a1fdad4a3c23b3bf8e99a66df04c985cfa77","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":22442668,"name":"origin","full_name":"openshift/origin","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/origin","description":"Enterprise-Ready Kubernetes for Developers","fork":false,"url":"https://api.github.com/repos/openshift/origin","forks_url":"https://api.github.com/repos/openshift/origin/forks","keys_url":"https://api.github.com/repos/openshift/origin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/origin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/origin/teams","hooks_url":"https://api.github.com/repos/openshift/origin/hooks","issue_events_url":"https://api.github.com/repos/openshift/origin/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/origin/events","assignees_url":"https://api.github.com/repos/openshift/origin/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/origin/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/origin/tags","blobs_url":"https://api.github.com/repos/openshift/origin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/origin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/origin/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/origin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/origin/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/origin/languages","stargazers_url":"https://api.github.com/repos/openshift/origin/stargazers","contributors_url":"https://api.github.com/repos/openshift/origin/contributors","subscribers_url":"https://api.github.com/repos/openshift/origin/subscribers","subscription_url":"https://api.github.com/repos/openshift/origin/subscription","commits_url":"https://api.github.com/repos/openshift/origin/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/origin/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/origin/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/origin/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/origin/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/origin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/origin/merges","archive_url":"https://api.github.com/repos/openshift/origin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/origin/downloads","issues_url":"https://api.github.com/repos/openshift/origin/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/origin/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/origin/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/origin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/origin/labels{/name}","releases_url":"https://api.github.com/repos/openshift/origin/releases{/id}","deployments_url":"https://api.github.com/repos/openshift/origin/deployments","created_at":"2014-07-30T20:04:05Z","updated_at":"2016-09-18T23:41:36Z","pushed_at":"2016-09-19T00:19:17Z","git_url":"git://github.com/openshift/origin.git","ssh_url":"git@github.com:openshift/origin.git","clone_url":"https://github.com/openshift/origin.git","svn_url":"https://github.com/openshift/origin","homepage":"http://www.openshift.org","size":589686,"stargazers_count":1740,"watchers_count":1740,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1119,"mirror_url":null,"open_issues_count":1221,"forks":1119,"open_issues":1221,"watchers":1740,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/origin/pulls/10883"},"html":{"href":"https://github.com/openshift/origin/pull/10883"},"issue":{"href":"https://api.github.com/repos/openshift/origin/issues/10883"},"comments":{"href":"https://api.github.com/repos/openshift/origin/issues/10883/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/origin/pulls/10883/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/origin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/origin/pulls/10883/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/origin/statuses/09ef7093d5037c06019642196896a65e2b81ec78"}}}}
{"actor":{"display_login":"smarterclayton"}}