{"action":"created","comment":{"url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls/comments/76425243","id":76425243,"diff_hunk":"@@ -0,0 +1,81 @@\n+package helper\n+\n+import (\n+\t\"archive/tar\"\n+\t\"errors\"\n+\t\"io\"\n+\t\"io/ioutil\"\n+\t\"log\"\n+\t\"os\"\n+\t\"path/filepath\"\n+)\n+\n+func GetApplication(applicationsPath, applicationUUID string) (string, string, error) {\n+\tcommit, err := getCommit(applicationsPath, applicationUUID)\n+\tif err != nil {\n+\t\tlog.Printf(\"Failed to get commit. Error: %s\\r\\n\", err)\n+\t\treturn \"\", \"\", err\n+\t}\n+\n+\tbasePath := filepath.Join(applicationsPath, applicationUUID, commit)\n+\ttarball := filepath.Join(basePath, \"binary.tar\")\n+\tapplication := filepath.Join(basePath, \"application.zip\")\n+\n+\t_, err = os.Stat(application)\n+\tif err != nil {","path":"helper/helper.go","position":25,"original_position":25,"commit_id":"6332c5dde85fdf69c26e369807766d125c269393","original_commit_id":"6332c5dde85fdf69c26e369807766d125c269393","user":{"login":"lorenzo-stoakes","id":305511,"avatar_url":"https://avatars.githubusercontent.com/u/305511?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenzo-stoakes","html_url":"https://github.com/lorenzo-stoakes","followers_url":"https://api.github.com/users/lorenzo-stoakes/followers","following_url":"https://api.github.com/users/lorenzo-stoakes/following{/other_user}","gists_url":"https://api.github.com/users/lorenzo-stoakes/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzo-stoakes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzo-stoakes/subscriptions","organizations_url":"https://api.github.com/users/lorenzo-stoakes/orgs","repos_url":"https://api.github.com/users/lorenzo-stoakes/repos","events_url":"https://api.github.com/users/lorenzo-stoakes/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzo-stoakes/received_events","type":"User","site_admin":false},"body":"If the error _isn't_ `nil` you proceed? I'm confused here - is this because you expect the application to exist otherwise you untar?\r\n\r\nIn that case you should emphatically _not_ ignore the error type and assume it means it doesn't exist. You should use the [os.IsNotExist](https://golang.org/pkg/os/#IsNotExist) function to determine if the error is of that type and if not return the error.\r\n\r\nAlso again you're creating unnecessary nesting. If you combine the use of declaring vars at the top (see top comment for this file) and a guard clause here this can be made a lot cleaner.","created_at":"2016-08-26T14:15:14Z","updated_at":"2016-08-26T14:15:14Z","html_url":"https://github.com/resin-io-playground/edge-node-manager/pull/1#discussion_r76425243","pull_request_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls/comments/76425243"},"html":{"href":"https://github.com/resin-io-playground/edge-node-manager/pull/1#discussion_r76425243"},"pull_request":{"href":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls/1","id":81055059,"html_url":"https://github.com/resin-io-playground/edge-node-manager/pull/1","diff_url":"https://github.com/resin-io-playground/edge-node-manager/pull/1.diff","patch_url":"https://github.com/resin-io-playground/edge-node-manager/pull/1.patch","issue_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/issues/1","number":1,"state":"open","locked":false,"title":"architecture","user":{"login":"josephroberts","id":1107385,"avatar_url":"https://avatars.githubusercontent.com/u/1107385?v=3","gravatar_id":"","url":"https://api.github.com/users/josephroberts","html_url":"https://github.com/josephroberts","followers_url":"https://api.github.com/users/josephroberts/followers","following_url":"https://api.github.com/users/josephroberts/following{/other_user}","gists_url":"https://api.github.com/users/josephroberts/gists{/gist_id}","starred_url":"https://api.github.com/users/josephroberts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josephroberts/subscriptions","organizations_url":"https://api.github.com/users/josephroberts/orgs","repos_url":"https://api.github.com/users/josephroberts/repos","events_url":"https://api.github.com/users/josephroberts/events{/privacy}","received_events_url":"https://api.github.com/users/josephroberts/received_events","type":"User","site_admin":false},"body":"Please review guys, currently stuck on how to call methods on individual radios that are not defined in the RadioInterface e.g.\r\n```\r\ndevice/nrf51822.go:85: d.GetDevice().Radio.WriteCharacteristic undefined (type radio.RadioInterface has no field or method WriteCharacteristic)\r\n```\r\n\r\nalso @lorenzo-stoakes I do have a switch in device.go :( I couldn't think of another way to create the correct device type on deserialisation. Your nifty, deserialise, serialise, deserialise trick works nicely\r\n\r\nI'm gonna be pretty busy on the beast until w/c 22nd so no rush.\r\n\r\nThanks\r\n","created_at":"2016-08-12T01:03:36Z","updated_at":"2016-08-26T14:15:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d8059457425bfe27da78ae7902494d7ffbc1f01","assignee":{"login":"lorenzo-stoakes","id":305511,"avatar_url":"https://avatars.githubusercontent.com/u/305511?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenzo-stoakes","html_url":"https://github.com/lorenzo-stoakes","followers_url":"https://api.github.com/users/lorenzo-stoakes/followers","following_url":"https://api.github.com/users/lorenzo-stoakes/following{/other_user}","gists_url":"https://api.github.com/users/lorenzo-stoakes/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzo-stoakes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzo-stoakes/subscriptions","organizations_url":"https://api.github.com/users/lorenzo-stoakes/orgs","repos_url":"https://api.github.com/users/lorenzo-stoakes/repos","events_url":"https://api.github.com/users/lorenzo-stoakes/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzo-stoakes/received_events","type":"User","site_admin":false},"assignees":[{"login":"lorenzo-stoakes","id":305511,"avatar_url":"https://avatars.githubusercontent.com/u/305511?v=3","gravatar_id":"","url":"https://api.github.com/users/lorenzo-stoakes","html_url":"https://github.com/lorenzo-stoakes","followers_url":"https://api.github.com/users/lorenzo-stoakes/followers","following_url":"https://api.github.com/users/lorenzo-stoakes/following{/other_user}","gists_url":"https://api.github.com/users/lorenzo-stoakes/gists{/gist_id}","starred_url":"https://api.github.com/users/lorenzo-stoakes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorenzo-stoakes/subscriptions","organizations_url":"https://api.github.com/users/lorenzo-stoakes/orgs","repos_url":"https://api.github.com/users/lorenzo-stoakes/repos","events_url":"https://api.github.com/users/lorenzo-stoakes/events{/privacy}","received_events_url":"https://api.github.com/users/lorenzo-stoakes/received_events","type":"User","site_admin":false},{"login":"abresas","id":938774,"avatar_url":"https://avatars.githubusercontent.com/u/938774?v=3","gravatar_id":"","url":"https://api.github.com/users/abresas","html_url":"https://github.com/abresas","followers_url":"https://api.github.com/users/abresas/followers","following_url":"https://api.github.com/users/abresas/following{/other_user}","gists_url":"https://api.github.com/users/abresas/gists{/gist_id}","starred_url":"https://api.github.com/users/abresas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abresas/subscriptions","organizations_url":"https://api.github.com/users/abresas/orgs","repos_url":"https://api.github.com/users/abresas/repos","events_url":"https://api.github.com/users/abresas/events{/privacy}","received_events_url":"https://api.github.com/users/abresas/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls/1/commits","review_comments_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls/1/comments","review_comment_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/issues/1/comments","statuses_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/statuses/6332c5dde85fdf69c26e369807766d125c269393","head":{"label":"resin-io-playground:initial-architecture","ref":"initial-architecture","sha":"6332c5dde85fdf69c26e369807766d125c269393","user":{"login":"resin-io-playground","id":18610741,"avatar_url":"https://avatars.githubusercontent.com/u/18610741?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-io-playground","html_url":"https://github.com/resin-io-playground","followers_url":"https://api.github.com/users/resin-io-playground/followers","following_url":"https://api.github.com/users/resin-io-playground/following{/other_user}","gists_url":"https://api.github.com/users/resin-io-playground/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io-playground/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io-playground/subscriptions","organizations_url":"https://api.github.com/users/resin-io-playground/orgs","repos_url":"https://api.github.com/users/resin-io-playground/repos","events_url":"https://api.github.com/users/resin-io-playground/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io-playground/received_events","type":"Organization","site_admin":false},"repo":{"id":65510883,"name":"edge-node-manager","full_name":"resin-io-playground/edge-node-manager","owner":{"login":"resin-io-playground","id":18610741,"avatar_url":"https://avatars.githubusercontent.com/u/18610741?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-io-playground","html_url":"https://github.com/resin-io-playground","followers_url":"https://api.github.com/users/resin-io-playground/followers","following_url":"https://api.github.com/users/resin-io-playground/following{/other_user}","gists_url":"https://api.github.com/users/resin-io-playground/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io-playground/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io-playground/subscriptions","organizations_url":"https://api.github.com/users/resin-io-playground/orgs","repos_url":"https://api.github.com/users/resin-io-playground/repos","events_url":"https://api.github.com/users/resin-io-playground/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io-playground/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-io-playground/edge-node-manager","description":"Resin uC edge-node-manager written in Go","fork":false,"url":"https://api.github.com/repos/resin-io-playground/edge-node-manager","forks_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/forks","keys_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/teams","hooks_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/hooks","issue_events_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/issues/events{/number}","events_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/events","assignees_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/assignees{/user}","branches_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/branches{/branch}","tags_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/tags","blobs_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/languages","stargazers_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/stargazers","contributors_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/contributors","subscribers_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/subscribers","subscription_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/subscription","commits_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/contents/{+path}","compare_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/merges","archive_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/downloads","issues_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/issues{/number}","pulls_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/labels{/name}","releases_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/releases{/id}","deployments_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/deployments","created_at":"2016-08-12T00:37:33Z","updated_at":"2016-08-12T00:37:33Z","pushed_at":"2016-08-25T12:56:01Z","git_url":"git://github.com/resin-io-playground/edge-node-manager.git","ssh_url":"git@github.com:resin-io-playground/edge-node-manager.git","clone_url":"https://github.com/resin-io-playground/edge-node-manager.git","svn_url":"https://github.com/resin-io-playground/edge-node-manager","homepage":null,"size":50,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"resin-io-playground:develop","ref":"develop","sha":"65447a9173be7a0065e3ed91df3c9c668d31123d","user":{"login":"resin-io-playground","id":18610741,"avatar_url":"https://avatars.githubusercontent.com/u/18610741?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-io-playground","html_url":"https://github.com/resin-io-playground","followers_url":"https://api.github.com/users/resin-io-playground/followers","following_url":"https://api.github.com/users/resin-io-playground/following{/other_user}","gists_url":"https://api.github.com/users/resin-io-playground/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io-playground/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io-playground/subscriptions","organizations_url":"https://api.github.com/users/resin-io-playground/orgs","repos_url":"https://api.github.com/users/resin-io-playground/repos","events_url":"https://api.github.com/users/resin-io-playground/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io-playground/received_events","type":"Organization","site_admin":false},"repo":{"id":65510883,"name":"edge-node-manager","full_name":"resin-io-playground/edge-node-manager","owner":{"login":"resin-io-playground","id":18610741,"avatar_url":"https://avatars.githubusercontent.com/u/18610741?v=3","gravatar_id":"","url":"https://api.github.com/users/resin-io-playground","html_url":"https://github.com/resin-io-playground","followers_url":"https://api.github.com/users/resin-io-playground/followers","following_url":"https://api.github.com/users/resin-io-playground/following{/other_user}","gists_url":"https://api.github.com/users/resin-io-playground/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io-playground/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io-playground/subscriptions","organizations_url":"https://api.github.com/users/resin-io-playground/orgs","repos_url":"https://api.github.com/users/resin-io-playground/repos","events_url":"https://api.github.com/users/resin-io-playground/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io-playground/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-io-playground/edge-node-manager","description":"Resin uC edge-node-manager written in Go","fork":false,"url":"https://api.github.com/repos/resin-io-playground/edge-node-manager","forks_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/forks","keys_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/teams","hooks_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/hooks","issue_events_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/issues/events{/number}","events_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/events","assignees_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/assignees{/user}","branches_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/branches{/branch}","tags_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/tags","blobs_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/languages","stargazers_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/stargazers","contributors_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/contributors","subscribers_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/subscribers","subscription_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/subscription","commits_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/contents/{+path}","compare_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/merges","archive_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/downloads","issues_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/issues{/number}","pulls_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/labels{/name}","releases_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/releases{/id}","deployments_url":"https://api.github.com/repos/resin-io-playground/edge-node-manager/deployments","created_at":"2016-08-12T00:37:33Z","updated_at":"2016-08-12T00:37:33Z","pushed_at":"2016-08-25T12:56:01Z","git_url":"git://github.com/resin-io-playground/edge-node-manager.git","ssh_url":"git@github.com:resin-io-playground/edge-node-manager.git","clone_url":"https://github.com/resin-io-playground/edge-node-manager.git","svn_url":"https://github.com/resin-io-playground/edge-node-manager","homepage":null,"size":50,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls/1"},"html":{"href":"https://github.com/resin-io-playground/edge-node-manager/pull/1"},"issue":{"href":"https://api.github.com/repos/resin-io-playground/edge-node-manager/issues/1"},"comments":{"href":"https://api.github.com/repos/resin-io-playground/edge-node-manager/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/resin-io-playground/edge-node-manager/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/resin-io-playground/edge-node-manager/statuses/6332c5dde85fdf69c26e369807766d125c269393"}}}}
{"actor":{"display_login":"lorenzo-stoakes"}}