{"action":"created","comment":{"url":"https://api.github.com/repos/getlantern/pac/pulls/comments/24882288","id":24882288,"diff_hunk":"@@ -2,14 +2,31 @@ package main\n \n import (\n \t\"fmt\"\n+\t\"os\"\n+\t\"path/filepath\"\n+\t\"runtime\"\n \n-\t\"github.com/getlantern/pacon\"\n+\t\"github.com/getlantern/pac\"\n )\n \n func main() {\n-\tpacon.PacOn(\"localhost:12345/pac\")\n-\tfmt.Println(\"proxy set, any key to continue...\")\n+\tpac.SetHelperPath(absPath(\"./pac-cmd\"))\n+\tif runtime.GOOS == \"darwin\" {\n+\t\tpac.SetIconPathOnOSX(absPath(\"icon.png\"))\n+\t\tpac.SetPromptOnOSX(\"Input your password and save the world!\")\n+\t}\n+\terr := pac.On(\"localhost:12345/pac\")\n+\tif err != nil {\n+\t\tfmt.Printf(\"Error set proxy: %s\\n\", err)\n+\t\treturn\n+\t}\n+\tfmt.Println(\"proxy set, Enter continue...\")\n \tvar i int\n \tfmt.Scanf(\"%d\\n\", &i)\n-\tpacon.PacOff()\n+\tpac.Off()\n+}\n+\n+func absPath(name string) string {\n+\twd, _ := filepath.Abs(filepath.Dir(os.Args[0]))","path":"example/main.go","position":33,"original_position":33,"commit_id":"154ea52f4ffe2c3897f8e0690cb53056879a52c9","original_commit_id":"154ea52f4ffe2c3897f8e0690cb53056879a52c9","user":{"login":"oxtoacart","id":5000654,"avatar_url":"https://avatars.githubusercontent.com/u/5000654?v=3","gravatar_id":"","url":"https://api.github.com/users/oxtoacart","html_url":"https://github.com/oxtoacart","followers_url":"https://api.github.com/users/oxtoacart/followers","following_url":"https://api.github.com/users/oxtoacart/following{/other_user}","gists_url":"https://api.github.com/users/oxtoacart/gists{/gist_id}","starred_url":"https://api.github.com/users/oxtoacart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxtoacart/subscriptions","organizations_url":"https://api.github.com/users/oxtoacart/orgs","repos_url":"https://api.github.com/users/oxtoacart/repos","events_url":"https://api.github.com/users/oxtoacart/events{/privacy}","received_events_url":"https://api.github.com/users/oxtoacart/received_events","type":"User","site_admin":false},"body":"Cool.","created_at":"2015-02-18T07:03:01Z","updated_at":"2015-02-18T07:03:01Z","html_url":"https://github.com/getlantern/pac/pull/2#discussion_r24882288","pull_request_url":"https://api.github.com/repos/getlantern/pac/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/getlantern/pac/pulls/comments/24882288"},"html":{"href":"https://github.com/getlantern/pac/pull/2#discussion_r24882288"},"pull_request":{"href":"https://api.github.com/repos/getlantern/pac/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/getlantern/pac/pulls/2","id":29321839,"html_url":"https://github.com/getlantern/pac/pull/2","diff_url":"https://github.com/getlantern/pac/pull/2.diff","patch_url":"https://github.com/getlantern/pac/pull/2.patch","issue_url":"https://api.github.com/repos/getlantern/pac/issues/2","number":2,"state":"open","locked":false,"title":"Extract cmd tools","user":{"login":"fffw","id":10410437,"avatar_url":"https://avatars.githubusercontent.com/u/10410437?v=3","gravatar_id":"","url":"https://api.github.com/users/fffw","html_url":"https://github.com/fffw","followers_url":"https://api.github.com/users/fffw/followers","following_url":"https://api.github.com/users/fffw/following{/other_user}","gists_url":"https://api.github.com/users/fffw/gists{/gist_id}","starred_url":"https://api.github.com/users/fffw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fffw/subscriptions","organizations_url":"https://api.github.com/users/fffw/orgs","repos_url":"https://api.github.com/users/fffw/repos","events_url":"https://api.github.com/users/fffw/events{/privacy}","received_events_url":"https://api.github.com/users/fffw/received_events","type":"User","site_admin":false},"body":"Extracted actual work to a command line tool https://github.com/getlantern/pac-cmd .\r\nHere's the code to embed, extract, elevate and execute the tool.","created_at":"2015-02-14T16:04:56Z","updated_at":"2015-02-18T07:03:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31b0dbf284127f2f69545e815c0e0d56b1b93521","assignee":{"login":"oxtoacart","id":5000654,"avatar_url":"https://avatars.githubusercontent.com/u/5000654?v=3","gravatar_id":"","url":"https://api.github.com/users/oxtoacart","html_url":"https://github.com/oxtoacart","followers_url":"https://api.github.com/users/oxtoacart/followers","following_url":"https://api.github.com/users/oxtoacart/following{/other_user}","gists_url":"https://api.github.com/users/oxtoacart/gists{/gist_id}","starred_url":"https://api.github.com/users/oxtoacart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxtoacart/subscriptions","organizations_url":"https://api.github.com/users/oxtoacart/orgs","repos_url":"https://api.github.com/users/oxtoacart/repos","events_url":"https://api.github.com/users/oxtoacart/events{/privacy}","received_events_url":"https://api.github.com/users/oxtoacart/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/getlantern/pac/pulls/2/commits","review_comments_url":"https://api.github.com/repos/getlantern/pac/pulls/2/comments","review_comment_url":"https://api.github.com/repos/getlantern/pac/pulls/comments/{number}","comments_url":"https://api.github.com/repos/getlantern/pac/issues/2/comments","statuses_url":"https://api.github.com/repos/getlantern/pac/statuses/154ea52f4ffe2c3897f8e0690cb53056879a52c9","head":{"label":"getlantern:extract-cmd-tools","ref":"extract-cmd-tools","sha":"154ea52f4ffe2c3897f8e0690cb53056879a52c9","user":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"repo":{"id":29567256,"name":"pac","full_name":"getlantern/pac","owner":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getlantern/pac","description":"A simple Go library to toggle on and off system pac for various OS","fork":false,"url":"https://api.github.com/repos/getlantern/pac","forks_url":"https://api.github.com/repos/getlantern/pac/forks","keys_url":"https://api.github.com/repos/getlantern/pac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getlantern/pac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getlantern/pac/teams","hooks_url":"https://api.github.com/repos/getlantern/pac/hooks","issue_events_url":"https://api.github.com/repos/getlantern/pac/issues/events{/number}","events_url":"https://api.github.com/repos/getlantern/pac/events","assignees_url":"https://api.github.com/repos/getlantern/pac/assignees{/user}","branches_url":"https://api.github.com/repos/getlantern/pac/branches{/branch}","tags_url":"https://api.github.com/repos/getlantern/pac/tags","blobs_url":"https://api.github.com/repos/getlantern/pac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getlantern/pac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getlantern/pac/git/refs{/sha}","trees_url":"https://api.github.com/repos/getlantern/pac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getlantern/pac/statuses/{sha}","languages_url":"https://api.github.com/repos/getlantern/pac/languages","stargazers_url":"https://api.github.com/repos/getlantern/pac/stargazers","contributors_url":"https://api.github.com/repos/getlantern/pac/contributors","subscribers_url":"https://api.github.com/repos/getlantern/pac/subscribers","subscription_url":"https://api.github.com/repos/getlantern/pac/subscription","commits_url":"https://api.github.com/repos/getlantern/pac/commits{/sha}","git_commits_url":"https://api.github.com/repos/getlantern/pac/git/commits{/sha}","comments_url":"https://api.github.com/repos/getlantern/pac/comments{/number}","issue_comment_url":"https://api.github.com/repos/getlantern/pac/issues/comments/{number}","contents_url":"https://api.github.com/repos/getlantern/pac/contents/{+path}","compare_url":"https://api.github.com/repos/getlantern/pac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getlantern/pac/merges","archive_url":"https://api.github.com/repos/getlantern/pac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getlantern/pac/downloads","issues_url":"https://api.github.com/repos/getlantern/pac/issues{/number}","pulls_url":"https://api.github.com/repos/getlantern/pac/pulls{/number}","milestones_url":"https://api.github.com/repos/getlantern/pac/milestones{/number}","notifications_url":"https://api.github.com/repos/getlantern/pac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getlantern/pac/labels{/name}","releases_url":"https://api.github.com/repos/getlantern/pac/releases{/id}","created_at":"2015-01-21T02:37:10Z","updated_at":"2015-02-14T07:43:56Z","pushed_at":"2015-02-16T23:57:22Z","git_url":"git://github.com/getlantern/pac.git","ssh_url":"git@github.com:getlantern/pac.git","clone_url":"https://github.com/getlantern/pac.git","svn_url":"https://github.com/getlantern/pac","homepage":null,"size":336,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","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":"getlantern:master","ref":"master","sha":"9150820b38f2e3876fa8c339ebc121cabe2b1416","user":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"repo":{"id":29567256,"name":"pac","full_name":"getlantern/pac","owner":{"login":"getlantern","id":624178,"avatar_url":"https://avatars.githubusercontent.com/u/624178?v=3","gravatar_id":"","url":"https://api.github.com/users/getlantern","html_url":"https://github.com/getlantern","followers_url":"https://api.github.com/users/getlantern/followers","following_url":"https://api.github.com/users/getlantern/following{/other_user}","gists_url":"https://api.github.com/users/getlantern/gists{/gist_id}","starred_url":"https://api.github.com/users/getlantern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getlantern/subscriptions","organizations_url":"https://api.github.com/users/getlantern/orgs","repos_url":"https://api.github.com/users/getlantern/repos","events_url":"https://api.github.com/users/getlantern/events{/privacy}","received_events_url":"https://api.github.com/users/getlantern/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getlantern/pac","description":"A simple Go library to toggle on and off system pac for various OS","fork":false,"url":"https://api.github.com/repos/getlantern/pac","forks_url":"https://api.github.com/repos/getlantern/pac/forks","keys_url":"https://api.github.com/repos/getlantern/pac/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getlantern/pac/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getlantern/pac/teams","hooks_url":"https://api.github.com/repos/getlantern/pac/hooks","issue_events_url":"https://api.github.com/repos/getlantern/pac/issues/events{/number}","events_url":"https://api.github.com/repos/getlantern/pac/events","assignees_url":"https://api.github.com/repos/getlantern/pac/assignees{/user}","branches_url":"https://api.github.com/repos/getlantern/pac/branches{/branch}","tags_url":"https://api.github.com/repos/getlantern/pac/tags","blobs_url":"https://api.github.com/repos/getlantern/pac/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getlantern/pac/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getlantern/pac/git/refs{/sha}","trees_url":"https://api.github.com/repos/getlantern/pac/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getlantern/pac/statuses/{sha}","languages_url":"https://api.github.com/repos/getlantern/pac/languages","stargazers_url":"https://api.github.com/repos/getlantern/pac/stargazers","contributors_url":"https://api.github.com/repos/getlantern/pac/contributors","subscribers_url":"https://api.github.com/repos/getlantern/pac/subscribers","subscription_url":"https://api.github.com/repos/getlantern/pac/subscription","commits_url":"https://api.github.com/repos/getlantern/pac/commits{/sha}","git_commits_url":"https://api.github.com/repos/getlantern/pac/git/commits{/sha}","comments_url":"https://api.github.com/repos/getlantern/pac/comments{/number}","issue_comment_url":"https://api.github.com/repos/getlantern/pac/issues/comments/{number}","contents_url":"https://api.github.com/repos/getlantern/pac/contents/{+path}","compare_url":"https://api.github.com/repos/getlantern/pac/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getlantern/pac/merges","archive_url":"https://api.github.com/repos/getlantern/pac/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getlantern/pac/downloads","issues_url":"https://api.github.com/repos/getlantern/pac/issues{/number}","pulls_url":"https://api.github.com/repos/getlantern/pac/pulls{/number}","milestones_url":"https://api.github.com/repos/getlantern/pac/milestones{/number}","notifications_url":"https://api.github.com/repos/getlantern/pac/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getlantern/pac/labels{/name}","releases_url":"https://api.github.com/repos/getlantern/pac/releases{/id}","created_at":"2015-01-21T02:37:10Z","updated_at":"2015-02-14T07:43:56Z","pushed_at":"2015-02-16T23:57:22Z","git_url":"git://github.com/getlantern/pac.git","ssh_url":"git@github.com:getlantern/pac.git","clone_url":"https://github.com/getlantern/pac.git","svn_url":"https://github.com/getlantern/pac","homepage":null,"size":336,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","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/getlantern/pac/pulls/2"},"html":{"href":"https://github.com/getlantern/pac/pull/2"},"issue":{"href":"https://api.github.com/repos/getlantern/pac/issues/2"},"comments":{"href":"https://api.github.com/repos/getlantern/pac/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/getlantern/pac/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/getlantern/pac/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/getlantern/pac/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/getlantern/pac/statuses/154ea52f4ffe2c3897f8e0690cb53056879a52c9"}}}}