{"action":"created","comment":{"url":"https://api.github.com/repos/vektah/gqlgen/pulls/comments/205993410","pull_request_review_id":141366756,"id":205993410,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTk5MzQxMA==","diff_hunk":"@@ -70,26 +70,24 @@ func initConfig() {\n \tvar err error\n \tif configFilename != \"\" {\n \t\tconfig, err = codegen.LoadConfig(configFilename)\n-\t} else {\n-\t\tconfig, err = codegen.LoadDefaultConfig()\n-\t}\n-\tif os.IsNotExist(errors.Cause(err)) {\n-\t\t// ok\n-\t\tif configFilename == \"\" {\n-\t\t\tconfigFilename = \".gqlgen.yml\"\n+\t\tif err != nil {","path":"cmd/init.go","position":21,"original_position":21,"commit_id":"56335087d42b4c4f45ec10bef0bf033b135a9da2","original_commit_id":"56335087d42b4c4f45ec10bef0bf033b135a9da2","user":{"login":"vektah","id":2247982,"node_id":"MDQ6VXNlcjIyNDc5ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/2247982?v=4","gravatar_id":"","url":"https://api.github.com/users/vektah","html_url":"https://github.com/vektah","followers_url":"https://api.github.com/users/vektah/followers","following_url":"https://api.github.com/users/vektah/following{/other_user}","gists_url":"https://api.github.com/users/vektah/gists{/gist_id}","starred_url":"https://api.github.com/users/vektah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vektah/subscriptions","organizations_url":"https://api.github.com/users/vektah/orgs","repos_url":"https://api.github.com/users/vektah/repos","events_url":"https://api.github.com/users/vektah/events{/privacy}","received_events_url":"https://api.github.com/users/vektah/received_events","type":"User","site_admin":false},"body":"Shouldn't this also check if it already exists?","created_at":"2018-07-30T00:28:07Z","updated_at":"2018-07-30T00:31:46Z","html_url":"https://github.com/vektah/gqlgen/pull/229#discussion_r205993410","pull_request_url":"https://api.github.com/repos/vektah/gqlgen/pulls/229","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/vektah/gqlgen/pulls/comments/205993410"},"html":{"href":"https://github.com/vektah/gqlgen/pull/229#discussion_r205993410"},"pull_request":{"href":"https://api.github.com/repos/vektah/gqlgen/pulls/229"}}},"pull_request":{"url":"https://api.github.com/repos/vektah/gqlgen/pulls/229","id":204326420,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MzI2NDIw","html_url":"https://github.com/vektah/gqlgen/pull/229","diff_url":"https://github.com/vektah/gqlgen/pull/229.diff","patch_url":"https://github.com/vektah/gqlgen/pull/229.patch","issue_url":"https://api.github.com/repos/vektah/gqlgen/issues/229","number":229,"state":"open","locked":false,"title":"Fixing init command","user":{"login":"creativej","id":568659,"node_id":"MDQ6VXNlcjU2ODY1OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/568659?v=4","gravatar_id":"","url":"https://api.github.com/users/creativej","html_url":"https://github.com/creativej","followers_url":"https://api.github.com/users/creativej/followers","following_url":"https://api.github.com/users/creativej/following{/other_user}","gists_url":"https://api.github.com/users/creativej/gists{/gist_id}","starred_url":"https://api.github.com/users/creativej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/creativej/subscriptions","organizations_url":"https://api.github.com/users/creativej/orgs","repos_url":"https://api.github.com/users/creativej/repos","events_url":"https://api.github.com/users/creativej/events{/privacy}","received_events_url":"https://api.github.com/users/creativej/received_events","type":"User","site_admin":false},"body":"The init command always return \"file already exists\" error if there are no\r\nconfigFilename specified\r\n\r\nThis is caused by `codegen.LoadDefaultConfig()` hiding the loading details\r\nand always return the default config with no error while the init\r\ncommand code expects it to tell us if config doesn't exists in default\r\nlocations.\r\n\r\nTo avoid confusion I have split out the loading config code into its own function so we can handle different cases easier.\r\n\r\nAdditionally I also moved default config into its own function so we always\r\ngenerating new a config instead of passing it around and potentially\r\nmutating the default config.","created_at":"2018-07-27T04:24:47Z","updated_at":"2018-07-30T00:31:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fa8f012164b3f0ac9a3ddb475309eb9ed832aa5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vektah/gqlgen/pulls/229/commits","review_comments_url":"https://api.github.com/repos/vektah/gqlgen/pulls/229/comments","review_comment_url":"https://api.github.com/repos/vektah/gqlgen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vektah/gqlgen/issues/229/comments","statuses_url":"https://api.github.com/repos/vektah/gqlgen/statuses/56335087d42b4c4f45ec10bef0bf033b135a9da2","head":{"label":"vektah:fix-init-command","ref":"fix-init-command","sha":"56335087d42b4c4f45ec10bef0bf033b135a9da2","user":{"login":"vektah","id":2247982,"node_id":"MDQ6VXNlcjIyNDc5ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/2247982?v=4","gravatar_id":"","url":"https://api.github.com/users/vektah","html_url":"https://github.com/vektah","followers_url":"https://api.github.com/users/vektah/followers","following_url":"https://api.github.com/users/vektah/following{/other_user}","gists_url":"https://api.github.com/users/vektah/gists{/gist_id}","starred_url":"https://api.github.com/users/vektah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vektah/subscriptions","organizations_url":"https://api.github.com/users/vektah/orgs","repos_url":"https://api.github.com/users/vektah/repos","events_url":"https://api.github.com/users/vektah/events{/privacy}","received_events_url":"https://api.github.com/users/vektah/received_events","type":"User","site_admin":false},"repo":{"id":121086193,"node_id":"MDEwOlJlcG9zaXRvcnkxMjEwODYxOTM=","name":"gqlgen","full_name":"vektah/gqlgen","owner":{"login":"vektah","id":2247982,"node_id":"MDQ6VXNlcjIyNDc5ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/2247982?v=4","gravatar_id":"","url":"https://api.github.com/users/vektah","html_url":"https://github.com/vektah","followers_url":"https://api.github.com/users/vektah/followers","following_url":"https://api.github.com/users/vektah/following{/other_user}","gists_url":"https://api.github.com/users/vektah/gists{/gist_id}","starred_url":"https://api.github.com/users/vektah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vektah/subscriptions","organizations_url":"https://api.github.com/users/vektah/orgs","repos_url":"https://api.github.com/users/vektah/repos","events_url":"https://api.github.com/users/vektah/events{/privacy}","received_events_url":"https://api.github.com/users/vektah/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vektah/gqlgen","description":"go generate based graphql server library","fork":false,"url":"https://api.github.com/repos/vektah/gqlgen","forks_url":"https://api.github.com/repos/vektah/gqlgen/forks","keys_url":"https://api.github.com/repos/vektah/gqlgen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vektah/gqlgen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vektah/gqlgen/teams","hooks_url":"https://api.github.com/repos/vektah/gqlgen/hooks","issue_events_url":"https://api.github.com/repos/vektah/gqlgen/issues/events{/number}","events_url":"https://api.github.com/repos/vektah/gqlgen/events","assignees_url":"https://api.github.com/repos/vektah/gqlgen/assignees{/user}","branches_url":"https://api.github.com/repos/vektah/gqlgen/branches{/branch}","tags_url":"https://api.github.com/repos/vektah/gqlgen/tags","blobs_url":"https://api.github.com/repos/vektah/gqlgen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vektah/gqlgen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vektah/gqlgen/git/refs{/sha}","trees_url":"https://api.github.com/repos/vektah/gqlgen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vektah/gqlgen/statuses/{sha}","languages_url":"https://api.github.com/repos/vektah/gqlgen/languages","stargazers_url":"https://api.github.com/repos/vektah/gqlgen/stargazers","contributors_url":"https://api.github.com/repos/vektah/gqlgen/contributors","subscribers_url":"https://api.github.com/repos/vektah/gqlgen/subscribers","subscription_url":"https://api.github.com/repos/vektah/gqlgen/subscription","commits_url":"https://api.github.com/repos/vektah/gqlgen/commits{/sha}","git_commits_url":"https://api.github.com/repos/vektah/gqlgen/git/commits{/sha}","comments_url":"https://api.github.com/repos/vektah/gqlgen/comments{/number}","issue_comment_url":"https://api.github.com/repos/vektah/gqlgen/issues/comments{/number}","contents_url":"https://api.github.com/repos/vektah/gqlgen/contents/{+path}","compare_url":"https://api.github.com/repos/vektah/gqlgen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vektah/gqlgen/merges","archive_url":"https://api.github.com/repos/vektah/gqlgen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vektah/gqlgen/downloads","issues_url":"https://api.github.com/repos/vektah/gqlgen/issues{/number}","pulls_url":"https://api.github.com/repos/vektah/gqlgen/pulls{/number}","milestones_url":"https://api.github.com/repos/vektah/gqlgen/milestones{/number}","notifications_url":"https://api.github.com/repos/vektah/gqlgen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vektah/gqlgen/labels{/name}","releases_url":"https://api.github.com/repos/vektah/gqlgen/releases{/id}","deployments_url":"https://api.github.com/repos/vektah/gqlgen/deployments","created_at":"2018-02-11T04:54:11Z","updated_at":"2018-07-29T12:12:47Z","pushed_at":"2018-07-28T12:42:44Z","git_url":"git://github.com/vektah/gqlgen.git","ssh_url":"git@github.com:vektah/gqlgen.git","clone_url":"https://github.com/vektah/gqlgen.git","svn_url":"https://github.com/vektah/gqlgen","homepage":"","size":1539,"stargazers_count":1228,"watchers_count":1228,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":57,"mirror_url":null,"archived":false,"open_issues_count":30,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":57,"open_issues":30,"watchers":1228,"default_branch":"master"}},"base":{"label":"vektah:next","ref":"next","sha":"803711e941fa9465ebd4ffa7565cba84412a26f9","user":{"login":"vektah","id":2247982,"node_id":"MDQ6VXNlcjIyNDc5ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/2247982?v=4","gravatar_id":"","url":"https://api.github.com/users/vektah","html_url":"https://github.com/vektah","followers_url":"https://api.github.com/users/vektah/followers","following_url":"https://api.github.com/users/vektah/following{/other_user}","gists_url":"https://api.github.com/users/vektah/gists{/gist_id}","starred_url":"https://api.github.com/users/vektah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vektah/subscriptions","organizations_url":"https://api.github.com/users/vektah/orgs","repos_url":"https://api.github.com/users/vektah/repos","events_url":"https://api.github.com/users/vektah/events{/privacy}","received_events_url":"https://api.github.com/users/vektah/received_events","type":"User","site_admin":false},"repo":{"id":121086193,"node_id":"MDEwOlJlcG9zaXRvcnkxMjEwODYxOTM=","name":"gqlgen","full_name":"vektah/gqlgen","owner":{"login":"vektah","id":2247982,"node_id":"MDQ6VXNlcjIyNDc5ODI=","avatar_url":"https://avatars0.githubusercontent.com/u/2247982?v=4","gravatar_id":"","url":"https://api.github.com/users/vektah","html_url":"https://github.com/vektah","followers_url":"https://api.github.com/users/vektah/followers","following_url":"https://api.github.com/users/vektah/following{/other_user}","gists_url":"https://api.github.com/users/vektah/gists{/gist_id}","starred_url":"https://api.github.com/users/vektah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vektah/subscriptions","organizations_url":"https://api.github.com/users/vektah/orgs","repos_url":"https://api.github.com/users/vektah/repos","events_url":"https://api.github.com/users/vektah/events{/privacy}","received_events_url":"https://api.github.com/users/vektah/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vektah/gqlgen","description":"go generate based graphql server library","fork":false,"url":"https://api.github.com/repos/vektah/gqlgen","forks_url":"https://api.github.com/repos/vektah/gqlgen/forks","keys_url":"https://api.github.com/repos/vektah/gqlgen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vektah/gqlgen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vektah/gqlgen/teams","hooks_url":"https://api.github.com/repos/vektah/gqlgen/hooks","issue_events_url":"https://api.github.com/repos/vektah/gqlgen/issues/events{/number}","events_url":"https://api.github.com/repos/vektah/gqlgen/events","assignees_url":"https://api.github.com/repos/vektah/gqlgen/assignees{/user}","branches_url":"https://api.github.com/repos/vektah/gqlgen/branches{/branch}","tags_url":"https://api.github.com/repos/vektah/gqlgen/tags","blobs_url":"https://api.github.com/repos/vektah/gqlgen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vektah/gqlgen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vektah/gqlgen/git/refs{/sha}","trees_url":"https://api.github.com/repos/vektah/gqlgen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vektah/gqlgen/statuses/{sha}","languages_url":"https://api.github.com/repos/vektah/gqlgen/languages","stargazers_url":"https://api.github.com/repos/vektah/gqlgen/stargazers","contributors_url":"https://api.github.com/repos/vektah/gqlgen/contributors","subscribers_url":"https://api.github.com/repos/vektah/gqlgen/subscribers","subscription_url":"https://api.github.com/repos/vektah/gqlgen/subscription","commits_url":"https://api.github.com/repos/vektah/gqlgen/commits{/sha}","git_commits_url":"https://api.github.com/repos/vektah/gqlgen/git/commits{/sha}","comments_url":"https://api.github.com/repos/vektah/gqlgen/comments{/number}","issue_comment_url":"https://api.github.com/repos/vektah/gqlgen/issues/comments{/number}","contents_url":"https://api.github.com/repos/vektah/gqlgen/contents/{+path}","compare_url":"https://api.github.com/repos/vektah/gqlgen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vektah/gqlgen/merges","archive_url":"https://api.github.com/repos/vektah/gqlgen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vektah/gqlgen/downloads","issues_url":"https://api.github.com/repos/vektah/gqlgen/issues{/number}","pulls_url":"https://api.github.com/repos/vektah/gqlgen/pulls{/number}","milestones_url":"https://api.github.com/repos/vektah/gqlgen/milestones{/number}","notifications_url":"https://api.github.com/repos/vektah/gqlgen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vektah/gqlgen/labels{/name}","releases_url":"https://api.github.com/repos/vektah/gqlgen/releases{/id}","deployments_url":"https://api.github.com/repos/vektah/gqlgen/deployments","created_at":"2018-02-11T04:54:11Z","updated_at":"2018-07-29T12:12:47Z","pushed_at":"2018-07-28T12:42:44Z","git_url":"git://github.com/vektah/gqlgen.git","ssh_url":"git@github.com:vektah/gqlgen.git","clone_url":"https://github.com/vektah/gqlgen.git","svn_url":"https://github.com/vektah/gqlgen","homepage":"","size":1539,"stargazers_count":1228,"watchers_count":1228,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":57,"mirror_url":null,"archived":false,"open_issues_count":30,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":57,"open_issues":30,"watchers":1228,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vektah/gqlgen/pulls/229"},"html":{"href":"https://github.com/vektah/gqlgen/pull/229"},"issue":{"href":"https://api.github.com/repos/vektah/gqlgen/issues/229"},"comments":{"href":"https://api.github.com/repos/vektah/gqlgen/issues/229/comments"},"review_comments":{"href":"https://api.github.com/repos/vektah/gqlgen/pulls/229/comments"},"review_comment":{"href":"https://api.github.com/repos/vektah/gqlgen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vektah/gqlgen/pulls/229/commits"},"statuses":{"href":"https://api.github.com/repos/vektah/gqlgen/statuses/56335087d42b4c4f45ec10bef0bf033b135a9da2"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"vektah"}}