{"action":"created","comment":{"url":"https://api.github.com/repos/tools/godep/pulls/comments/38673118","id":38673118,"diff_hunk":"@@ -49,7 +50,12 @@ func rewriteTree(path, qual string, paths []string) error {\n \t\t\tlog.Println(\"rewrite:\", w.Err())\n \t\t\tcontinue\n \t\t}\n-\t\tif !w.Stat().IsDir() && strings.HasSuffix(w.Path(), \".go\") {\n+\t\ts := w.Stat()","path":"rewrite.go","position":13,"original_position":13,"commit_id":"c6a06a8ff902dfbb130222f142682dacbecdd142","original_commit_id":"c6a06a8ff902dfbb130222f142682dacbecdd142","user":{"login":"freeformz","id":103,"avatar_url":"https://avatars.githubusercontent.com/u/103?v=3","gravatar_id":"","url":"https://api.github.com/users/freeformz","html_url":"https://github.com/freeformz","followers_url":"https://api.github.com/users/freeformz/followers","following_url":"https://api.github.com/users/freeformz/following{/other_user}","gists_url":"https://api.github.com/users/freeformz/gists{/gist_id}","starred_url":"https://api.github.com/users/freeformz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freeformz/subscriptions","organizations_url":"https://api.github.com/users/freeformz/orgs","repos_url":"https://api.github.com/users/freeformz/repos","events_url":"https://api.github.com/users/freeformz/events{/privacy}","received_events_url":"https://api.github.com/users/freeformz/received_events","type":"User","site_admin":false},"body":"For me anyway this makes the intent clearer:\r\n\r\n```go\r\ns := w.Stat()\r\nswitch s.IsDir() {\r\n  case true:\r\n    if s.Name() == \"testdata\" {\r\n      w.SkipDir()\r\n      continue\r\n    }\r\n  case false:\r\n    if strings.HasSuffix(w.Path(), \".go\") {\r\n      if err := rewriteGoFile(w.Path(), qual, paths); err != nil {\r\n        return err\r\n      }\r\n    }\r\n}\r\n```\r\n\r\nFeel free not to change it though.","created_at":"2015-09-03T17:37:24Z","updated_at":"2015-09-03T17:37:24Z","html_url":"https://github.com/tools/godep/pull/267#discussion_r38673118","pull_request_url":"https://api.github.com/repos/tools/godep/pulls/267","_links":{"self":{"href":"https://api.github.com/repos/tools/godep/pulls/comments/38673118"},"html":{"href":"https://github.com/tools/godep/pull/267#discussion_r38673118"},"pull_request":{"href":"https://api.github.com/repos/tools/godep/pulls/267"}}},"pull_request":{"url":"https://api.github.com/repos/tools/godep/pulls/267","id":44060055,"html_url":"https://github.com/tools/godep/pull/267","diff_url":"https://github.com/tools/godep/pull/267.diff","patch_url":"https://github.com/tools/godep/pull/267.patch","issue_url":"https://api.github.com/repos/tools/godep/issues/267","number":267,"state":"open","locked":false,"title":"Do not parse Go files in testdata directories.","user":{"login":"neurogeek","id":243474,"avatar_url":"https://avatars.githubusercontent.com/u/243474?v=3","gravatar_id":"","url":"https://api.github.com/users/neurogeek","html_url":"https://github.com/neurogeek","followers_url":"https://api.github.com/users/neurogeek/followers","following_url":"https://api.github.com/users/neurogeek/following{/other_user}","gists_url":"https://api.github.com/users/neurogeek/gists{/gist_id}","starred_url":"https://api.github.com/users/neurogeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neurogeek/subscriptions","organizations_url":"https://api.github.com/users/neurogeek/orgs","repos_url":"https://api.github.com/users/neurogeek/repos","events_url":"https://api.github.com/users/neurogeek/events{/privacy}","received_events_url":"https://api.github.com/users/neurogeek/received_events","type":"User","site_admin":false},"body":"Revert ignoring testdata directories and instead, ignore it during the rewrite of Go files and copy the whole directory unmodified.\r\n\r\nThis commit fixes issue #140","created_at":"2015-09-03T01:01:09Z","updated_at":"2015-09-03T17:37:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef08faba36501107f3ceeef5f3c56d5ec204c610","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tools/godep/pulls/267/commits","review_comments_url":"https://api.github.com/repos/tools/godep/pulls/267/comments","review_comment_url":"https://api.github.com/repos/tools/godep/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tools/godep/issues/267/comments","statuses_url":"https://api.github.com/repos/tools/godep/statuses/c6a06a8ff902dfbb130222f142682dacbecdd142","head":{"label":"neurogeek:copy_testdata_unmodified","ref":"copy_testdata_unmodified","sha":"c6a06a8ff902dfbb130222f142682dacbecdd142","user":{"login":"neurogeek","id":243474,"avatar_url":"https://avatars.githubusercontent.com/u/243474?v=3","gravatar_id":"","url":"https://api.github.com/users/neurogeek","html_url":"https://github.com/neurogeek","followers_url":"https://api.github.com/users/neurogeek/followers","following_url":"https://api.github.com/users/neurogeek/following{/other_user}","gists_url":"https://api.github.com/users/neurogeek/gists{/gist_id}","starred_url":"https://api.github.com/users/neurogeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neurogeek/subscriptions","organizations_url":"https://api.github.com/users/neurogeek/orgs","repos_url":"https://api.github.com/users/neurogeek/repos","events_url":"https://api.github.com/users/neurogeek/events{/privacy}","received_events_url":"https://api.github.com/users/neurogeek/received_events","type":"User","site_admin":false},"repo":{"id":37603843,"name":"godep","full_name":"neurogeek/godep","owner":{"login":"neurogeek","id":243474,"avatar_url":"https://avatars.githubusercontent.com/u/243474?v=3","gravatar_id":"","url":"https://api.github.com/users/neurogeek","html_url":"https://github.com/neurogeek","followers_url":"https://api.github.com/users/neurogeek/followers","following_url":"https://api.github.com/users/neurogeek/following{/other_user}","gists_url":"https://api.github.com/users/neurogeek/gists{/gist_id}","starred_url":"https://api.github.com/users/neurogeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neurogeek/subscriptions","organizations_url":"https://api.github.com/users/neurogeek/orgs","repos_url":"https://api.github.com/users/neurogeek/repos","events_url":"https://api.github.com/users/neurogeek/events{/privacy}","received_events_url":"https://api.github.com/users/neurogeek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/neurogeek/godep","description":"dependency tool for go","fork":true,"url":"https://api.github.com/repos/neurogeek/godep","forks_url":"https://api.github.com/repos/neurogeek/godep/forks","keys_url":"https://api.github.com/repos/neurogeek/godep/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neurogeek/godep/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neurogeek/godep/teams","hooks_url":"https://api.github.com/repos/neurogeek/godep/hooks","issue_events_url":"https://api.github.com/repos/neurogeek/godep/issues/events{/number}","events_url":"https://api.github.com/repos/neurogeek/godep/events","assignees_url":"https://api.github.com/repos/neurogeek/godep/assignees{/user}","branches_url":"https://api.github.com/repos/neurogeek/godep/branches{/branch}","tags_url":"https://api.github.com/repos/neurogeek/godep/tags","blobs_url":"https://api.github.com/repos/neurogeek/godep/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neurogeek/godep/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neurogeek/godep/git/refs{/sha}","trees_url":"https://api.github.com/repos/neurogeek/godep/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neurogeek/godep/statuses/{sha}","languages_url":"https://api.github.com/repos/neurogeek/godep/languages","stargazers_url":"https://api.github.com/repos/neurogeek/godep/stargazers","contributors_url":"https://api.github.com/repos/neurogeek/godep/contributors","subscribers_url":"https://api.github.com/repos/neurogeek/godep/subscribers","subscription_url":"https://api.github.com/repos/neurogeek/godep/subscription","commits_url":"https://api.github.com/repos/neurogeek/godep/commits{/sha}","git_commits_url":"https://api.github.com/repos/neurogeek/godep/git/commits{/sha}","comments_url":"https://api.github.com/repos/neurogeek/godep/comments{/number}","issue_comment_url":"https://api.github.com/repos/neurogeek/godep/issues/comments{/number}","contents_url":"https://api.github.com/repos/neurogeek/godep/contents/{+path}","compare_url":"https://api.github.com/repos/neurogeek/godep/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neurogeek/godep/merges","archive_url":"https://api.github.com/repos/neurogeek/godep/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neurogeek/godep/downloads","issues_url":"https://api.github.com/repos/neurogeek/godep/issues{/number}","pulls_url":"https://api.github.com/repos/neurogeek/godep/pulls{/number}","milestones_url":"https://api.github.com/repos/neurogeek/godep/milestones{/number}","notifications_url":"https://api.github.com/repos/neurogeek/godep/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neurogeek/godep/labels{/name}","releases_url":"https://api.github.com/repos/neurogeek/godep/releases{/id}","created_at":"2015-06-17T15:34:52Z","updated_at":"2015-06-17T15:34:52Z","pushed_at":"2015-09-03T17:37:08Z","git_url":"git://github.com/neurogeek/godep.git","ssh_url":"git@github.com:neurogeek/godep.git","clone_url":"https://github.com/neurogeek/godep.git","svn_url":"https://github.com/neurogeek/godep","homepage":"http://godoc.org/github.com/tools/godep","size":257,"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":"tools:master","ref":"master","sha":"bb418303c7e0886d29a75b5bbec49b64cdc3fa1c","user":{"login":"tools","id":6775062,"avatar_url":"https://avatars.githubusercontent.com/u/6775062?v=3","gravatar_id":"","url":"https://api.github.com/users/tools","html_url":"https://github.com/tools","followers_url":"https://api.github.com/users/tools/followers","following_url":"https://api.github.com/users/tools/following{/other_user}","gists_url":"https://api.github.com/users/tools/gists{/gist_id}","starred_url":"https://api.github.com/users/tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tools/subscriptions","organizations_url":"https://api.github.com/users/tools/orgs","repos_url":"https://api.github.com/users/tools/repos","events_url":"https://api.github.com/users/tools/events{/privacy}","received_events_url":"https://api.github.com/users/tools/received_events","type":"Organization","site_admin":false},"repo":{"id":9787757,"name":"godep","full_name":"tools/godep","owner":{"login":"tools","id":6775062,"avatar_url":"https://avatars.githubusercontent.com/u/6775062?v=3","gravatar_id":"","url":"https://api.github.com/users/tools","html_url":"https://github.com/tools","followers_url":"https://api.github.com/users/tools/followers","following_url":"https://api.github.com/users/tools/following{/other_user}","gists_url":"https://api.github.com/users/tools/gists{/gist_id}","starred_url":"https://api.github.com/users/tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tools/subscriptions","organizations_url":"https://api.github.com/users/tools/orgs","repos_url":"https://api.github.com/users/tools/repos","events_url":"https://api.github.com/users/tools/events{/privacy}","received_events_url":"https://api.github.com/users/tools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tools/godep","description":"dependency tool for go","fork":false,"url":"https://api.github.com/repos/tools/godep","forks_url":"https://api.github.com/repos/tools/godep/forks","keys_url":"https://api.github.com/repos/tools/godep/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tools/godep/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tools/godep/teams","hooks_url":"https://api.github.com/repos/tools/godep/hooks","issue_events_url":"https://api.github.com/repos/tools/godep/issues/events{/number}","events_url":"https://api.github.com/repos/tools/godep/events","assignees_url":"https://api.github.com/repos/tools/godep/assignees{/user}","branches_url":"https://api.github.com/repos/tools/godep/branches{/branch}","tags_url":"https://api.github.com/repos/tools/godep/tags","blobs_url":"https://api.github.com/repos/tools/godep/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tools/godep/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tools/godep/git/refs{/sha}","trees_url":"https://api.github.com/repos/tools/godep/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tools/godep/statuses/{sha}","languages_url":"https://api.github.com/repos/tools/godep/languages","stargazers_url":"https://api.github.com/repos/tools/godep/stargazers","contributors_url":"https://api.github.com/repos/tools/godep/contributors","subscribers_url":"https://api.github.com/repos/tools/godep/subscribers","subscription_url":"https://api.github.com/repos/tools/godep/subscription","commits_url":"https://api.github.com/repos/tools/godep/commits{/sha}","git_commits_url":"https://api.github.com/repos/tools/godep/git/commits{/sha}","comments_url":"https://api.github.com/repos/tools/godep/comments{/number}","issue_comment_url":"https://api.github.com/repos/tools/godep/issues/comments{/number}","contents_url":"https://api.github.com/repos/tools/godep/contents/{+path}","compare_url":"https://api.github.com/repos/tools/godep/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tools/godep/merges","archive_url":"https://api.github.com/repos/tools/godep/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tools/godep/downloads","issues_url":"https://api.github.com/repos/tools/godep/issues{/number}","pulls_url":"https://api.github.com/repos/tools/godep/pulls{/number}","milestones_url":"https://api.github.com/repos/tools/godep/milestones{/number}","notifications_url":"https://api.github.com/repos/tools/godep/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tools/godep/labels{/name}","releases_url":"https://api.github.com/repos/tools/godep/releases{/id}","created_at":"2013-05-01T07:55:35Z","updated_at":"2015-09-03T14:23:29Z","pushed_at":"2015-09-03T17:37:08Z","git_url":"git://github.com/tools/godep.git","ssh_url":"git@github.com:tools/godep.git","clone_url":"https://github.com/tools/godep.git","svn_url":"https://github.com/tools/godep","homepage":"http://godoc.org/github.com/tools/godep","size":1476,"stargazers_count":2544,"watchers_count":2544,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":194,"mirror_url":null,"open_issues_count":80,"forks":194,"open_issues":80,"watchers":2544,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tools/godep/pulls/267"},"html":{"href":"https://github.com/tools/godep/pull/267"},"issue":{"href":"https://api.github.com/repos/tools/godep/issues/267"},"comments":{"href":"https://api.github.com/repos/tools/godep/issues/267/comments"},"review_comments":{"href":"https://api.github.com/repos/tools/godep/pulls/267/comments"},"review_comment":{"href":"https://api.github.com/repos/tools/godep/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tools/godep/pulls/267/commits"},"statuses":{"href":"https://api.github.com/repos/tools/godep/statuses/c6a06a8ff902dfbb130222f142682dacbecdd142"}}}}