{"action":"created","comment":{"url":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls/comments/67969413","id":67969413,"diff_hunk":"@@ -0,0 +1,69 @@\n+package main\n+\n+import (\n+\t\"encoding/json\"\n+\t\"os\"\n+\n+\t\"github.com/olekukonko/tablewriter\"\n+\n+\t\"gopkg.in/urfave/cli.v2\"\n+)\n+\n+var get getResponse\n+\n+type resourceParams struct {\n+\tTags []string `json:\"tags\"`\n+}\n+\n+func createResource(c *cli.Context, resourceType string) {\n+\tparams := makeBody(c)\n+\tvar table [][]string\n+\tswitch resourceType {\n+\tcase \"Folders\":\n+\t\ttable = getFolders(params)\n+\tcase \"Sites\":\n+\t\ttable = getSites(params)\n+\tdefault: //\"Browsers\"\n+\t\ttable = getBrowsers(params)\n+\t}\n+\tprintResource(resourceType, table)\n+}\n+\n+func makeBody(c *cli.Context) *resourceParams {\n+\treturn &resourceParams{\n+\t\tTags: c.StringSlice(\"tags\"),\n+\t}\n+}\n+\n+func getFolders(params *resourceParams) (tableData [][]string) {\n+\tvar resBody *foldersResp\n+\tdata := get.getRequest(\"https://app.rainforestqa.com/api/1/folders.json?page_size=100\")\n+\tjson.Unmarshal(data, &resBody)\n+\ttableData = resBody.TableSlice()\n+\treturn tableData","path":"resources.go","position":43,"original_position":43,"commit_id":"87b29591de25de639e742da57b6c8a87b51bb921","original_commit_id":"87b29591de25de639e742da57b6c8a87b51bb921","user":{"login":"epaulet","id":9178278,"avatar_url":"https://avatars.githubusercontent.com/u/9178278?v=3","gravatar_id":"","url":"https://api.github.com/users/epaulet","html_url":"https://github.com/epaulet","followers_url":"https://api.github.com/users/epaulet/followers","following_url":"https://api.github.com/users/epaulet/following{/other_user}","gists_url":"https://api.github.com/users/epaulet/gists{/gist_id}","starred_url":"https://api.github.com/users/epaulet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epaulet/subscriptions","organizations_url":"https://api.github.com/users/epaulet/orgs","repos_url":"https://api.github.com/users/epaulet/repos","events_url":"https://api.github.com/users/epaulet/events{/privacy}","received_events_url":"https://api.github.com/users/epaulet/received_events","type":"User","site_admin":false},"body":"it's more efficient to return pointers in this case","created_at":"2016-06-21T23:12:14Z","updated_at":"2016-06-21T23:12:14Z","html_url":"https://github.com/rainforestapp/rainforest-cli/pull/142#discussion_r67969413","pull_request_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls/142","_links":{"self":{"href":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls/comments/67969413"},"html":{"href":"https://github.com/rainforestapp/rainforest-cli/pull/142#discussion_r67969413"},"pull_request":{"href":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls/142"}}},"pull_request":{"url":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls/142","id":74300347,"html_url":"https://github.com/rainforestapp/rainforest-cli/pull/142","diff_url":"https://github.com/rainforestapp/rainforest-cli/pull/142.diff","patch_url":"https://github.com/rainforestapp/rainforest-cli/pull/142.patch","issue_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/issues/142","number":142,"state":"open","locked":false,"title":"[WIP] Refactor/go resources","user":{"login":"DyerSituation","id":12620122,"avatar_url":"https://avatars.githubusercontent.com/u/12620122?v=3","gravatar_id":"","url":"https://api.github.com/users/DyerSituation","html_url":"https://github.com/DyerSituation","followers_url":"https://api.github.com/users/DyerSituation/followers","following_url":"https://api.github.com/users/DyerSituation/following{/other_user}","gists_url":"https://api.github.com/users/DyerSituation/gists{/gist_id}","starred_url":"https://api.github.com/users/DyerSituation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DyerSituation/subscriptions","organizations_url":"https://api.github.com/users/DyerSituation/orgs","repos_url":"https://api.github.com/users/DyerSituation/repos","events_url":"https://api.github.com/users/DyerSituation/events{/privacy}","received_events_url":"https://api.github.com/users/DyerSituation/received_events","type":"User","site_admin":false},"body":"Retrieving folders, browsers, and sites and printing them in the cli.\r\nTo do: format results in readable table, write specs","created_at":"2016-06-17T20:25:57Z","updated_at":"2016-06-21T23:12:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60190836a7c8458095230d19509523d2e7d37cd4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls/142/commits","review_comments_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls/142/comments","review_comment_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/issues/142/comments","statuses_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/statuses/87b29591de25de639e742da57b6c8a87b51bb921","head":{"label":"DyerSituation:refactor/go-resources","ref":"refactor/go-resources","sha":"87b29591de25de639e742da57b6c8a87b51bb921","user":{"login":"DyerSituation","id":12620122,"avatar_url":"https://avatars.githubusercontent.com/u/12620122?v=3","gravatar_id":"","url":"https://api.github.com/users/DyerSituation","html_url":"https://github.com/DyerSituation","followers_url":"https://api.github.com/users/DyerSituation/followers","following_url":"https://api.github.com/users/DyerSituation/following{/other_user}","gists_url":"https://api.github.com/users/DyerSituation/gists{/gist_id}","starred_url":"https://api.github.com/users/DyerSituation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DyerSituation/subscriptions","organizations_url":"https://api.github.com/users/DyerSituation/orgs","repos_url":"https://api.github.com/users/DyerSituation/repos","events_url":"https://api.github.com/users/DyerSituation/events{/privacy}","received_events_url":"https://api.github.com/users/DyerSituation/received_events","type":"User","site_admin":false},"repo":{"id":61075456,"name":"rainforest-cli","full_name":"DyerSituation/rainforest-cli","owner":{"login":"DyerSituation","id":12620122,"avatar_url":"https://avatars.githubusercontent.com/u/12620122?v=3","gravatar_id":"","url":"https://api.github.com/users/DyerSituation","html_url":"https://github.com/DyerSituation","followers_url":"https://api.github.com/users/DyerSituation/followers","following_url":"https://api.github.com/users/DyerSituation/following{/other_user}","gists_url":"https://api.github.com/users/DyerSituation/gists{/gist_id}","starred_url":"https://api.github.com/users/DyerSituation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DyerSituation/subscriptions","organizations_url":"https://api.github.com/users/DyerSituation/orgs","repos_url":"https://api.github.com/users/DyerSituation/repos","events_url":"https://api.github.com/users/DyerSituation/events{/privacy}","received_events_url":"https://api.github.com/users/DyerSituation/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DyerSituation/rainforest-cli","description":"Command line interface to Rainforest","fork":true,"url":"https://api.github.com/repos/DyerSituation/rainforest-cli","forks_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/forks","keys_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/teams","hooks_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/hooks","issue_events_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/issues/events{/number}","events_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/events","assignees_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/assignees{/user}","branches_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/branches{/branch}","tags_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/tags","blobs_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/languages","stargazers_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/stargazers","contributors_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/contributors","subscribers_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/subscribers","subscription_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/subscription","commits_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/contents/{+path}","compare_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/merges","archive_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/downloads","issues_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/issues{/number}","pulls_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/labels{/name}","releases_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/releases{/id}","deployments_url":"https://api.github.com/repos/DyerSituation/rainforest-cli/deployments","created_at":"2016-06-13T23:05:25Z","updated_at":"2016-06-13T23:05:26Z","pushed_at":"2016-06-21T19:51:01Z","git_url":"git://github.com/DyerSituation/rainforest-cli.git","ssh_url":"git@github.com:DyerSituation/rainforest-cli.git","clone_url":"https://github.com/DyerSituation/rainforest-cli.git","svn_url":"https://github.com/DyerSituation/rainforest-cli","homepage":"https://www.rainforestqa.com/","size":363,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"rainforestapp:refactor/go","ref":"refactor/go","sha":"599cc00323bbd4bc2382ca3029daab5c66f25f0a","user":{"login":"rainforestapp","id":1892571,"avatar_url":"https://avatars.githubusercontent.com/u/1892571?v=3","gravatar_id":"","url":"https://api.github.com/users/rainforestapp","html_url":"https://github.com/rainforestapp","followers_url":"https://api.github.com/users/rainforestapp/followers","following_url":"https://api.github.com/users/rainforestapp/following{/other_user}","gists_url":"https://api.github.com/users/rainforestapp/gists{/gist_id}","starred_url":"https://api.github.com/users/rainforestapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainforestapp/subscriptions","organizations_url":"https://api.github.com/users/rainforestapp/orgs","repos_url":"https://api.github.com/users/rainforestapp/repos","events_url":"https://api.github.com/users/rainforestapp/events{/privacy}","received_events_url":"https://api.github.com/users/rainforestapp/received_events","type":"Organization","site_admin":false},"repo":{"id":11987995,"name":"rainforest-cli","full_name":"rainforestapp/rainforest-cli","owner":{"login":"rainforestapp","id":1892571,"avatar_url":"https://avatars.githubusercontent.com/u/1892571?v=3","gravatar_id":"","url":"https://api.github.com/users/rainforestapp","html_url":"https://github.com/rainforestapp","followers_url":"https://api.github.com/users/rainforestapp/followers","following_url":"https://api.github.com/users/rainforestapp/following{/other_user}","gists_url":"https://api.github.com/users/rainforestapp/gists{/gist_id}","starred_url":"https://api.github.com/users/rainforestapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainforestapp/subscriptions","organizations_url":"https://api.github.com/users/rainforestapp/orgs","repos_url":"https://api.github.com/users/rainforestapp/repos","events_url":"https://api.github.com/users/rainforestapp/events{/privacy}","received_events_url":"https://api.github.com/users/rainforestapp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rainforestapp/rainforest-cli","description":"Command line interface to Rainforest","fork":false,"url":"https://api.github.com/repos/rainforestapp/rainforest-cli","forks_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/forks","keys_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/teams","hooks_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/hooks","issue_events_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/issues/events{/number}","events_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/events","assignees_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/assignees{/user}","branches_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/branches{/branch}","tags_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/tags","blobs_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/languages","stargazers_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/stargazers","contributors_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/contributors","subscribers_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/subscribers","subscription_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/subscription","commits_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/contents/{+path}","compare_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/merges","archive_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/downloads","issues_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/issues{/number}","pulls_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/labels{/name}","releases_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/releases{/id}","deployments_url":"https://api.github.com/repos/rainforestapp/rainforest-cli/deployments","created_at":"2013-08-08T22:23:18Z","updated_at":"2016-06-13T23:40:55Z","pushed_at":"2016-06-21T19:51:02Z","git_url":"git://github.com/rainforestapp/rainforest-cli.git","ssh_url":"git@github.com:rainforestapp/rainforest-cli.git","clone_url":"https://github.com/rainforestapp/rainforest-cli.git","svn_url":"https://github.com/rainforestapp/rainforest-cli","homepage":"https://www.rainforestqa.com/","size":384,"stargazers_count":16,"watchers_count":16,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":12,"forks":14,"open_issues":12,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls/142"},"html":{"href":"https://github.com/rainforestapp/rainforest-cli/pull/142"},"issue":{"href":"https://api.github.com/repos/rainforestapp/rainforest-cli/issues/142"},"comments":{"href":"https://api.github.com/repos/rainforestapp/rainforest-cli/issues/142/comments"},"review_comments":{"href":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls/142/comments"},"review_comment":{"href":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rainforestapp/rainforest-cli/pulls/142/commits"},"statuses":{"href":"https://api.github.com/repos/rainforestapp/rainforest-cli/statuses/87b29591de25de639e742da57b6c8a87b51bb921"}}}}
{"actor":{"display_login":"epaulet"}}