{"action":"created","comment":{"url":"https://api.github.com/repos/lxc/lxd/pulls/comments/112555987","pull_request_review_id":33881371,"id":112555987,"diff_hunk":"@@ -21,27 +24,83 @@ func cmdNetcat(args []string) error {\n \t\treturn fmt.Errorf(\"Bad arguments %q\", args)\n \t}\n \n+\t// The socket name on LXD instances prior to netcat log file is:\n+\t// \t/<some-tmp-path/lxd_rsync_<random-suffix>\n+\t// and on LXD instances with netcat log file:\n+\t// \t/<some-tmp-path/lxd_<ctName>_rsync_<random-suffix>\n+\t// Detect the latter case and create a netcat log\n+\tvar logFile *os.File\n+\tvar err error\n+\tctName := \"\"\n+\tlogPath := \"\"\n+\tnamestart := strings.LastIndex(args[1], \"/lxd_\")","path":"lxd/main_netcat.go","position":25,"original_position":25,"commit_id":"400d0c8c5aa398c908d95b566734fd8e0a2d2a14","original_commit_id":"400d0c8c5aa398c908d95b566734fd8e0a2d2a14","user":{"login":"stgraber","id":2230599,"avatar_url":"https://avatars3.githubusercontent.com/u/2230599?v=3","gravatar_id":"","url":"https://api.github.com/users/stgraber","html_url":"https://github.com/stgraber","followers_url":"https://api.github.com/users/stgraber/followers","following_url":"https://api.github.com/users/stgraber/following{/other_user}","gists_url":"https://api.github.com/users/stgraber/gists{/gist_id}","starred_url":"https://api.github.com/users/stgraber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stgraber/subscriptions","organizations_url":"https://api.github.com/users/stgraber/orgs","repos_url":"https://api.github.com/users/stgraber/repos","events_url":"https://api.github.com/users/stgraber/events{/privacy}","received_events_url":"https://api.github.com/users/stgraber/received_events","type":"User","site_admin":false},"body":"I tend to stay away from regexp unless absolutely needed, they rarely improve code readability and don't have the best of security track records (though I'm not aware of any regexp compiler CVEs for Go). In a compiled and heavily optimized language like Go, they're also unlikely to give you the performance boost that they would in scripting languages.","created_at":"2017-04-20T20:42:50Z","updated_at":"2017-04-20T20:42:50Z","html_url":"https://github.com/lxc/lxd/pull/3196#discussion_r112555987","pull_request_url":"https://api.github.com/repos/lxc/lxd/pulls/3196","_links":{"self":{"href":"https://api.github.com/repos/lxc/lxd/pulls/comments/112555987"},"html":{"href":"https://github.com/lxc/lxd/pull/3196#discussion_r112555987"},"pull_request":{"href":"https://api.github.com/repos/lxc/lxd/pulls/3196"}}},"pull_request":{"url":"https://api.github.com/repos/lxc/lxd/pulls/3196","id":116762294,"html_url":"https://github.com/lxc/lxd/pull/3196","diff_url":"https://github.com/lxc/lxd/pull/3196.diff","patch_url":"https://github.com/lxc/lxd/pull/3196.patch","issue_url":"https://api.github.com/repos/lxc/lxd/issues/3196","number":3196,"state":"open","locked":false,"title":"netcat: add new errno detection helpers, switch netcat over to them and implement netcat logging","user":{"login":"brauner","id":7353573,"avatar_url":"https://avatars3.githubusercontent.com/u/7353573?v=3","gravatar_id":"","url":"https://api.github.com/users/brauner","html_url":"https://github.com/brauner","followers_url":"https://api.github.com/users/brauner/followers","following_url":"https://api.github.com/users/brauner/following{/other_user}","gists_url":"https://api.github.com/users/brauner/gists{/gist_id}","starred_url":"https://api.github.com/users/brauner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brauner/subscriptions","organizations_url":"https://api.github.com/users/brauner/orgs","repos_url":"https://api.github.com/users/brauner/repos","events_url":"https://api.github.com/users/brauner/events{/privacy}","received_events_url":"https://api.github.com/users/brauner/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>","created_at":"2017-04-20T12:44:39Z","updated_at":"2017-04-20T20:42:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"02a5e6aafba660b2104594b7b95260593230fb67","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/lxc/lxd/pulls/3196/commits","review_comments_url":"https://api.github.com/repos/lxc/lxd/pulls/3196/comments","review_comment_url":"https://api.github.com/repos/lxc/lxd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lxc/lxd/issues/3196/comments","statuses_url":"https://api.github.com/repos/lxc/lxd/statuses/400d0c8c5aa398c908d95b566734fd8e0a2d2a14","head":{"label":"brauner:2017-04-20/errno_detection","ref":"2017-04-20/errno_detection","sha":"400d0c8c5aa398c908d95b566734fd8e0a2d2a14","user":{"login":"brauner","id":7353573,"avatar_url":"https://avatars3.githubusercontent.com/u/7353573?v=3","gravatar_id":"","url":"https://api.github.com/users/brauner","html_url":"https://github.com/brauner","followers_url":"https://api.github.com/users/brauner/followers","following_url":"https://api.github.com/users/brauner/following{/other_user}","gists_url":"https://api.github.com/users/brauner/gists{/gist_id}","starred_url":"https://api.github.com/users/brauner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brauner/subscriptions","organizations_url":"https://api.github.com/users/brauner/orgs","repos_url":"https://api.github.com/users/brauner/repos","events_url":"https://api.github.com/users/brauner/events{/privacy}","received_events_url":"https://api.github.com/users/brauner/received_events","type":"User","site_admin":false},"repo":{"id":67736764,"name":"lxd","full_name":"brauner/lxd","owner":{"login":"brauner","id":7353573,"avatar_url":"https://avatars3.githubusercontent.com/u/7353573?v=3","gravatar_id":"","url":"https://api.github.com/users/brauner","html_url":"https://github.com/brauner","followers_url":"https://api.github.com/users/brauner/followers","following_url":"https://api.github.com/users/brauner/following{/other_user}","gists_url":"https://api.github.com/users/brauner/gists{/gist_id}","starred_url":"https://api.github.com/users/brauner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brauner/subscriptions","organizations_url":"https://api.github.com/users/brauner/orgs","repos_url":"https://api.github.com/users/brauner/repos","events_url":"https://api.github.com/users/brauner/events{/privacy}","received_events_url":"https://api.github.com/users/brauner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/brauner/lxd","description":"Daemon based on liblxc offering a REST API to manage containers","fork":true,"url":"https://api.github.com/repos/brauner/lxd","forks_url":"https://api.github.com/repos/brauner/lxd/forks","keys_url":"https://api.github.com/repos/brauner/lxd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brauner/lxd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brauner/lxd/teams","hooks_url":"https://api.github.com/repos/brauner/lxd/hooks","issue_events_url":"https://api.github.com/repos/brauner/lxd/issues/events{/number}","events_url":"https://api.github.com/repos/brauner/lxd/events","assignees_url":"https://api.github.com/repos/brauner/lxd/assignees{/user}","branches_url":"https://api.github.com/repos/brauner/lxd/branches{/branch}","tags_url":"https://api.github.com/repos/brauner/lxd/tags","blobs_url":"https://api.github.com/repos/brauner/lxd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brauner/lxd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brauner/lxd/git/refs{/sha}","trees_url":"https://api.github.com/repos/brauner/lxd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brauner/lxd/statuses/{sha}","languages_url":"https://api.github.com/repos/brauner/lxd/languages","stargazers_url":"https://api.github.com/repos/brauner/lxd/stargazers","contributors_url":"https://api.github.com/repos/brauner/lxd/contributors","subscribers_url":"https://api.github.com/repos/brauner/lxd/subscribers","subscription_url":"https://api.github.com/repos/brauner/lxd/subscription","commits_url":"https://api.github.com/repos/brauner/lxd/commits{/sha}","git_commits_url":"https://api.github.com/repos/brauner/lxd/git/commits{/sha}","comments_url":"https://api.github.com/repos/brauner/lxd/comments{/number}","issue_comment_url":"https://api.github.com/repos/brauner/lxd/issues/comments{/number}","contents_url":"https://api.github.com/repos/brauner/lxd/contents/{+path}","compare_url":"https://api.github.com/repos/brauner/lxd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brauner/lxd/merges","archive_url":"https://api.github.com/repos/brauner/lxd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brauner/lxd/downloads","issues_url":"https://api.github.com/repos/brauner/lxd/issues{/number}","pulls_url":"https://api.github.com/repos/brauner/lxd/pulls{/number}","milestones_url":"https://api.github.com/repos/brauner/lxd/milestones{/number}","notifications_url":"https://api.github.com/repos/brauner/lxd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brauner/lxd/labels{/name}","releases_url":"https://api.github.com/repos/brauner/lxd/releases{/id}","deployments_url":"https://api.github.com/repos/brauner/lxd/deployments","created_at":"2016-09-08T20:11:08Z","updated_at":"2016-09-08T20:11:10Z","pushed_at":"2017-04-20T16:27:22Z","git_url":"git://github.com/brauner/lxd.git","ssh_url":"git@github.com:brauner/lxd.git","clone_url":"https://github.com/brauner/lxd.git","svn_url":"https://github.com/brauner/lxd","homepage":"https://linuxcontainers.org/lxd","size":10791,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"lxc:master","ref":"master","sha":"a34055885a9d064110661af90dda5e74a1145a80","user":{"login":"lxc","id":2301756,"avatar_url":"https://avatars1.githubusercontent.com/u/2301756?v=3","gravatar_id":"","url":"https://api.github.com/users/lxc","html_url":"https://github.com/lxc","followers_url":"https://api.github.com/users/lxc/followers","following_url":"https://api.github.com/users/lxc/following{/other_user}","gists_url":"https://api.github.com/users/lxc/gists{/gist_id}","starred_url":"https://api.github.com/users/lxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxc/subscriptions","organizations_url":"https://api.github.com/users/lxc/orgs","repos_url":"https://api.github.com/users/lxc/repos","events_url":"https://api.github.com/users/lxc/events{/privacy}","received_events_url":"https://api.github.com/users/lxc/received_events","type":"Organization","site_admin":false},"repo":{"id":26192117,"name":"lxd","full_name":"lxc/lxd","owner":{"login":"lxc","id":2301756,"avatar_url":"https://avatars1.githubusercontent.com/u/2301756?v=3","gravatar_id":"","url":"https://api.github.com/users/lxc","html_url":"https://github.com/lxc","followers_url":"https://api.github.com/users/lxc/followers","following_url":"https://api.github.com/users/lxc/following{/other_user}","gists_url":"https://api.github.com/users/lxc/gists{/gist_id}","starred_url":"https://api.github.com/users/lxc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxc/subscriptions","organizations_url":"https://api.github.com/users/lxc/orgs","repos_url":"https://api.github.com/users/lxc/repos","events_url":"https://api.github.com/users/lxc/events{/privacy}","received_events_url":"https://api.github.com/users/lxc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lxc/lxd","description":"Daemon based on liblxc offering a REST API to manage containers","fork":false,"url":"https://api.github.com/repos/lxc/lxd","forks_url":"https://api.github.com/repos/lxc/lxd/forks","keys_url":"https://api.github.com/repos/lxc/lxd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lxc/lxd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lxc/lxd/teams","hooks_url":"https://api.github.com/repos/lxc/lxd/hooks","issue_events_url":"https://api.github.com/repos/lxc/lxd/issues/events{/number}","events_url":"https://api.github.com/repos/lxc/lxd/events","assignees_url":"https://api.github.com/repos/lxc/lxd/assignees{/user}","branches_url":"https://api.github.com/repos/lxc/lxd/branches{/branch}","tags_url":"https://api.github.com/repos/lxc/lxd/tags","blobs_url":"https://api.github.com/repos/lxc/lxd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lxc/lxd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lxc/lxd/git/refs{/sha}","trees_url":"https://api.github.com/repos/lxc/lxd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lxc/lxd/statuses/{sha}","languages_url":"https://api.github.com/repos/lxc/lxd/languages","stargazers_url":"https://api.github.com/repos/lxc/lxd/stargazers","contributors_url":"https://api.github.com/repos/lxc/lxd/contributors","subscribers_url":"https://api.github.com/repos/lxc/lxd/subscribers","subscription_url":"https://api.github.com/repos/lxc/lxd/subscription","commits_url":"https://api.github.com/repos/lxc/lxd/commits{/sha}","git_commits_url":"https://api.github.com/repos/lxc/lxd/git/commits{/sha}","comments_url":"https://api.github.com/repos/lxc/lxd/comments{/number}","issue_comment_url":"https://api.github.com/repos/lxc/lxd/issues/comments{/number}","contents_url":"https://api.github.com/repos/lxc/lxd/contents/{+path}","compare_url":"https://api.github.com/repos/lxc/lxd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lxc/lxd/merges","archive_url":"https://api.github.com/repos/lxc/lxd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lxc/lxd/downloads","issues_url":"https://api.github.com/repos/lxc/lxd/issues{/number}","pulls_url":"https://api.github.com/repos/lxc/lxd/pulls{/number}","milestones_url":"https://api.github.com/repos/lxc/lxd/milestones{/number}","notifications_url":"https://api.github.com/repos/lxc/lxd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lxc/lxd/labels{/name}","releases_url":"https://api.github.com/repos/lxc/lxd/releases{/id}","deployments_url":"https://api.github.com/repos/lxc/lxd/deployments","created_at":"2014-11-04T22:40:52Z","updated_at":"2017-04-20T07:35:54Z","pushed_at":"2017-04-20T16:27:24Z","git_url":"git://github.com/lxc/lxd.git","ssh_url":"git@github.com:lxc/lxd.git","clone_url":"https://github.com/lxc/lxd.git","svn_url":"https://github.com/lxc/lxd","homepage":"https://linuxcontainers.org/lxd","size":11076,"stargazers_count":1330,"watchers_count":1330,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":296,"mirror_url":null,"open_issues_count":73,"forks":296,"open_issues":73,"watchers":1330,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lxc/lxd/pulls/3196"},"html":{"href":"https://github.com/lxc/lxd/pull/3196"},"issue":{"href":"https://api.github.com/repos/lxc/lxd/issues/3196"},"comments":{"href":"https://api.github.com/repos/lxc/lxd/issues/3196/comments"},"review_comments":{"href":"https://api.github.com/repos/lxc/lxd/pulls/3196/comments"},"review_comment":{"href":"https://api.github.com/repos/lxc/lxd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lxc/lxd/pulls/3196/commits"},"statuses":{"href":"https://api.github.com/repos/lxc/lxd/statuses/400d0c8c5aa398c908d95b566734fd8e0a2d2a14"}}}}
{"actor":{"display_login":"stgraber"}}