{"action":"created","comment":{"url":"https://api.github.com/repos/spf13/hugo/pulls/comments/55928744","id":55928744,"diff_hunk":"@@ -20,35 +20,37 @@ import (\n )\n \n func CheckErr(err error, s ...string) {\n-\tif err != nil {\n-\t\tif len(s) == 0 {\n-\t\t\tjww.CRITICAL.Println(err)\n-\t\t} else {\n-\t\t\tfor _, message := range s {\n-\t\t\t\tjww.ERROR.Println(message)\n-\t\t\t}\n-\t\t\tjww.ERROR.Println(err)\n-\t\t}\n-\t}\n+       if err == nil {\n+          return\n+       }\n+       if len(s) == 0 {\n+\t  jww.CRITICAL.Println(err)\n+\t  return \n+       }\n+       for _, message := range s {\n+           jww.ERROR.Println(message)\n+       }\n+       jww.ERROR.Println(err)       \n }\n \n func StopOnErr(err error, s ...string) {\n-\tif err != nil {\n-\t\tif len(s) == 0 {\n-\t\t\tnewMessage := err.Error()\n+\tif err == nil {\n+           return\n+\t}\n \n-\t\t\t// Printing an empty string results in a error with\n-\t\t\t// no message, no bueno.\n-\t\t\tif newMessage != \"\" {\n-\t\t\t\tjww.CRITICAL.Println(newMessage)\n-\t\t\t}\n-\t\t} else {\n-\t\t\tfor _, message := range s {\n-\t\t\t\tif message != \"\" {\n-\t\t\t\t\tjww.CRITICAL.Println(message)\n-\t\t\t\t}\n-\t\t\t}\n-\t\t}\n-\t\tos.Exit(-1)\n+        defer os.Exit(-1)\n+\n+\tif len(s) == 0 {","path":"utils/utils.go","position":50,"original_position":50,"commit_id":"c17ff7d529b7f1ca34a4c81abc07f7ea9253c5cb","original_commit_id":"c17ff7d529b7f1ca34a4c81abc07f7ea9253c5cb","user":{"login":"bep","id":394382,"avatar_url":"https://avatars.githubusercontent.com/u/394382?v=3","gravatar_id":"","url":"https://api.github.com/users/bep","html_url":"https://github.com/bep","followers_url":"https://api.github.com/users/bep/followers","following_url":"https://api.github.com/users/bep/following{/other_user}","gists_url":"https://api.github.com/users/bep/gists{/gist_id}","starred_url":"https://api.github.com/users/bep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bep/subscriptions","organizations_url":"https://api.github.com/users/bep/orgs","repos_url":"https://api.github.com/users/bep/repos","events_url":"https://api.github.com/users/bep/events{/privacy}","received_events_url":"https://api.github.com/users/bep/received_events","type":"User","site_admin":false},"body":"This doesn't look gofmt'ed","created_at":"2016-03-12T22:26:37Z","updated_at":"2016-03-12T22:26:37Z","html_url":"https://github.com/spf13/hugo/pull/1963#discussion_r55928744","pull_request_url":"https://api.github.com/repos/spf13/hugo/pulls/1963","_links":{"self":{"href":"https://api.github.com/repos/spf13/hugo/pulls/comments/55928744"},"html":{"href":"https://github.com/spf13/hugo/pull/1963#discussion_r55928744"},"pull_request":{"href":"https://api.github.com/repos/spf13/hugo/pulls/1963"}}},"pull_request":{"url":"https://api.github.com/repos/spf13/hugo/pulls/1963","id":62649854,"html_url":"https://github.com/spf13/hugo/pull/1963","diff_url":"https://github.com/spf13/hugo/pull/1963.diff","patch_url":"https://github.com/spf13/hugo/pull/1963.patch","issue_url":"https://api.github.com/repos/spf13/hugo/issues/1963","number":1963,"state":"open","locked":false,"title":"refactor utils","user":{"login":"srinivasreddy","id":198396,"avatar_url":"https://avatars.githubusercontent.com/u/198396?v=3","gravatar_id":"","url":"https://api.github.com/users/srinivasreddy","html_url":"https://github.com/srinivasreddy","followers_url":"https://api.github.com/users/srinivasreddy/followers","following_url":"https://api.github.com/users/srinivasreddy/following{/other_user}","gists_url":"https://api.github.com/users/srinivasreddy/gists{/gist_id}","starred_url":"https://api.github.com/users/srinivasreddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srinivasreddy/subscriptions","organizations_url":"https://api.github.com/users/srinivasreddy/orgs","repos_url":"https://api.github.com/users/srinivasreddy/repos","events_url":"https://api.github.com/users/srinivasreddy/events{/privacy}","received_events_url":"https://api.github.com/users/srinivasreddy/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-12T19:23:10Z","updated_at":"2016-03-12T22:26:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c816b65ef52c1d8303f8b761633ce7d1873d3e8e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spf13/hugo/pulls/1963/commits","review_comments_url":"https://api.github.com/repos/spf13/hugo/pulls/1963/comments","review_comment_url":"https://api.github.com/repos/spf13/hugo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spf13/hugo/issues/1963/comments","statuses_url":"https://api.github.com/repos/spf13/hugo/statuses/c17ff7d529b7f1ca34a4c81abc07f7ea9253c5cb","head":{"label":"srinivasreddy:refactor","ref":"refactor","sha":"c17ff7d529b7f1ca34a4c81abc07f7ea9253c5cb","user":{"login":"srinivasreddy","id":198396,"avatar_url":"https://avatars.githubusercontent.com/u/198396?v=3","gravatar_id":"","url":"https://api.github.com/users/srinivasreddy","html_url":"https://github.com/srinivasreddy","followers_url":"https://api.github.com/users/srinivasreddy/followers","following_url":"https://api.github.com/users/srinivasreddy/following{/other_user}","gists_url":"https://api.github.com/users/srinivasreddy/gists{/gist_id}","starred_url":"https://api.github.com/users/srinivasreddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srinivasreddy/subscriptions","organizations_url":"https://api.github.com/users/srinivasreddy/orgs","repos_url":"https://api.github.com/users/srinivasreddy/repos","events_url":"https://api.github.com/users/srinivasreddy/events{/privacy}","received_events_url":"https://api.github.com/users/srinivasreddy/received_events","type":"User","site_admin":false},"repo":{"id":53379733,"name":"hugo","full_name":"srinivasreddy/hugo","owner":{"login":"srinivasreddy","id":198396,"avatar_url":"https://avatars.githubusercontent.com/u/198396?v=3","gravatar_id":"","url":"https://api.github.com/users/srinivasreddy","html_url":"https://github.com/srinivasreddy","followers_url":"https://api.github.com/users/srinivasreddy/followers","following_url":"https://api.github.com/users/srinivasreddy/following{/other_user}","gists_url":"https://api.github.com/users/srinivasreddy/gists{/gist_id}","starred_url":"https://api.github.com/users/srinivasreddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srinivasreddy/subscriptions","organizations_url":"https://api.github.com/users/srinivasreddy/orgs","repos_url":"https://api.github.com/users/srinivasreddy/repos","events_url":"https://api.github.com/users/srinivasreddy/events{/privacy}","received_events_url":"https://api.github.com/users/srinivasreddy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/srinivasreddy/hugo","description":"A Fast and Flexible Static Site Generator built with love in GoLang","fork":true,"url":"https://api.github.com/repos/srinivasreddy/hugo","forks_url":"https://api.github.com/repos/srinivasreddy/hugo/forks","keys_url":"https://api.github.com/repos/srinivasreddy/hugo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/srinivasreddy/hugo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/srinivasreddy/hugo/teams","hooks_url":"https://api.github.com/repos/srinivasreddy/hugo/hooks","issue_events_url":"https://api.github.com/repos/srinivasreddy/hugo/issues/events{/number}","events_url":"https://api.github.com/repos/srinivasreddy/hugo/events","assignees_url":"https://api.github.com/repos/srinivasreddy/hugo/assignees{/user}","branches_url":"https://api.github.com/repos/srinivasreddy/hugo/branches{/branch}","tags_url":"https://api.github.com/repos/srinivasreddy/hugo/tags","blobs_url":"https://api.github.com/repos/srinivasreddy/hugo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/srinivasreddy/hugo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/srinivasreddy/hugo/git/refs{/sha}","trees_url":"https://api.github.com/repos/srinivasreddy/hugo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/srinivasreddy/hugo/statuses/{sha}","languages_url":"https://api.github.com/repos/srinivasreddy/hugo/languages","stargazers_url":"https://api.github.com/repos/srinivasreddy/hugo/stargazers","contributors_url":"https://api.github.com/repos/srinivasreddy/hugo/contributors","subscribers_url":"https://api.github.com/repos/srinivasreddy/hugo/subscribers","subscription_url":"https://api.github.com/repos/srinivasreddy/hugo/subscription","commits_url":"https://api.github.com/repos/srinivasreddy/hugo/commits{/sha}","git_commits_url":"https://api.github.com/repos/srinivasreddy/hugo/git/commits{/sha}","comments_url":"https://api.github.com/repos/srinivasreddy/hugo/comments{/number}","issue_comment_url":"https://api.github.com/repos/srinivasreddy/hugo/issues/comments{/number}","contents_url":"https://api.github.com/repos/srinivasreddy/hugo/contents/{+path}","compare_url":"https://api.github.com/repos/srinivasreddy/hugo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/srinivasreddy/hugo/merges","archive_url":"https://api.github.com/repos/srinivasreddy/hugo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/srinivasreddy/hugo/downloads","issues_url":"https://api.github.com/repos/srinivasreddy/hugo/issues{/number}","pulls_url":"https://api.github.com/repos/srinivasreddy/hugo/pulls{/number}","milestones_url":"https://api.github.com/repos/srinivasreddy/hugo/milestones{/number}","notifications_url":"https://api.github.com/repos/srinivasreddy/hugo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/srinivasreddy/hugo/labels{/name}","releases_url":"https://api.github.com/repos/srinivasreddy/hugo/releases{/id}","deployments_url":"https://api.github.com/repos/srinivasreddy/hugo/deployments","created_at":"2016-03-08T03:34:01Z","updated_at":"2016-03-08T03:34:03Z","pushed_at":"2016-03-12T21:55:34Z","git_url":"git://github.com/srinivasreddy/hugo.git","ssh_url":"git@github.com:srinivasreddy/hugo.git","clone_url":"https://github.com/srinivasreddy/hugo.git","svn_url":"https://github.com/srinivasreddy/hugo","homepage":"http://gohugo.io","size":27762,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"spf13:master","ref":"master","sha":"989c7487ebe369f3cdfab4b654267e5949b92414","user":{"login":"spf13","id":173412,"avatar_url":"https://avatars.githubusercontent.com/u/173412?v=3","gravatar_id":"","url":"https://api.github.com/users/spf13","html_url":"https://github.com/spf13","followers_url":"https://api.github.com/users/spf13/followers","following_url":"https://api.github.com/users/spf13/following{/other_user}","gists_url":"https://api.github.com/users/spf13/gists{/gist_id}","starred_url":"https://api.github.com/users/spf13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spf13/subscriptions","organizations_url":"https://api.github.com/users/spf13/orgs","repos_url":"https://api.github.com/users/spf13/repos","events_url":"https://api.github.com/users/spf13/events{/privacy}","received_events_url":"https://api.github.com/users/spf13/received_events","type":"User","site_admin":false},"repo":{"id":11180687,"name":"hugo","full_name":"spf13/hugo","owner":{"login":"spf13","id":173412,"avatar_url":"https://avatars.githubusercontent.com/u/173412?v=3","gravatar_id":"","url":"https://api.github.com/users/spf13","html_url":"https://github.com/spf13","followers_url":"https://api.github.com/users/spf13/followers","following_url":"https://api.github.com/users/spf13/following{/other_user}","gists_url":"https://api.github.com/users/spf13/gists{/gist_id}","starred_url":"https://api.github.com/users/spf13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spf13/subscriptions","organizations_url":"https://api.github.com/users/spf13/orgs","repos_url":"https://api.github.com/users/spf13/repos","events_url":"https://api.github.com/users/spf13/events{/privacy}","received_events_url":"https://api.github.com/users/spf13/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spf13/hugo","description":"A Fast and Flexible Static Site Generator built with love in GoLang","fork":false,"url":"https://api.github.com/repos/spf13/hugo","forks_url":"https://api.github.com/repos/spf13/hugo/forks","keys_url":"https://api.github.com/repos/spf13/hugo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spf13/hugo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spf13/hugo/teams","hooks_url":"https://api.github.com/repos/spf13/hugo/hooks","issue_events_url":"https://api.github.com/repos/spf13/hugo/issues/events{/number}","events_url":"https://api.github.com/repos/spf13/hugo/events","assignees_url":"https://api.github.com/repos/spf13/hugo/assignees{/user}","branches_url":"https://api.github.com/repos/spf13/hugo/branches{/branch}","tags_url":"https://api.github.com/repos/spf13/hugo/tags","blobs_url":"https://api.github.com/repos/spf13/hugo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spf13/hugo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spf13/hugo/git/refs{/sha}","trees_url":"https://api.github.com/repos/spf13/hugo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spf13/hugo/statuses/{sha}","languages_url":"https://api.github.com/repos/spf13/hugo/languages","stargazers_url":"https://api.github.com/repos/spf13/hugo/stargazers","contributors_url":"https://api.github.com/repos/spf13/hugo/contributors","subscribers_url":"https://api.github.com/repos/spf13/hugo/subscribers","subscription_url":"https://api.github.com/repos/spf13/hugo/subscription","commits_url":"https://api.github.com/repos/spf13/hugo/commits{/sha}","git_commits_url":"https://api.github.com/repos/spf13/hugo/git/commits{/sha}","comments_url":"https://api.github.com/repos/spf13/hugo/comments{/number}","issue_comment_url":"https://api.github.com/repos/spf13/hugo/issues/comments{/number}","contents_url":"https://api.github.com/repos/spf13/hugo/contents/{+path}","compare_url":"https://api.github.com/repos/spf13/hugo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spf13/hugo/merges","archive_url":"https://api.github.com/repos/spf13/hugo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spf13/hugo/downloads","issues_url":"https://api.github.com/repos/spf13/hugo/issues{/number}","pulls_url":"https://api.github.com/repos/spf13/hugo/pulls{/number}","milestones_url":"https://api.github.com/repos/spf13/hugo/milestones{/number}","notifications_url":"https://api.github.com/repos/spf13/hugo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spf13/hugo/labels{/name}","releases_url":"https://api.github.com/repos/spf13/hugo/releases{/id}","deployments_url":"https://api.github.com/repos/spf13/hugo/deployments","created_at":"2013-07-04T15:26:26Z","updated_at":"2016-03-12T20:49:40Z","pushed_at":"2016-03-12T21:55:35Z","git_url":"git://github.com/spf13/hugo.git","ssh_url":"git@github.com:spf13/hugo.git","clone_url":"https://github.com/spf13/hugo.git","svn_url":"https://github.com/spf13/hugo","homepage":"http://gohugo.io","size":39557,"stargazers_count":8765,"watchers_count":8765,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1423,"mirror_url":null,"open_issues_count":282,"forks":1423,"open_issues":282,"watchers":8765,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spf13/hugo/pulls/1963"},"html":{"href":"https://github.com/spf13/hugo/pull/1963"},"issue":{"href":"https://api.github.com/repos/spf13/hugo/issues/1963"},"comments":{"href":"https://api.github.com/repos/spf13/hugo/issues/1963/comments"},"review_comments":{"href":"https://api.github.com/repos/spf13/hugo/pulls/1963/comments"},"review_comment":{"href":"https://api.github.com/repos/spf13/hugo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spf13/hugo/pulls/1963/commits"},"statuses":{"href":"https://api.github.com/repos/spf13/hugo/statuses/c17ff7d529b7f1ca34a4c81abc07f7ea9253c5cb"}}}}