{"action":"created","comment":{"url":"https://api.github.com/repos/gongled/vgrepo/pulls/comments/117088793","pull_request_review_id":38764733,"id":117088793,"diff_hunk":"@@ -0,0 +1,56 @@\n+package prefs\n+\n+import (\n+\t\"pkg.re/essentialkaos/ek.v8/knf\"\n+\t\"pkg.re/essentialkaos/ek.v8/fmtc\"\n+\t\"os\"\n+\t\"pkg.re/essentialkaos/ek.v8/fsutil\"\n+)\n+\n+// ////////////////////////////////////////////////////////////////////////////////// //\n+\n+const (\n+\tSTORAGE_URL  = \"storage:url\"\n+\tSTORAGE_PATH = \"storage:path\"\n+)\n+\n+// ////////////////////////////////////////////////////////////////////////////////// //\n+\n+type Preferences struct {\n+\tStorageURL string\n+\tStoragePath string\n+}\n+\n+// ////////////////////////////////////////////////////////////////////////////////// //\n+\n+func (p *Preferences) Validate() []error {\n+\tvar errs []error\n+\n+\tif !fsutil.IsExist(p.StoragePath) {\n+\t\terrs = append(errs, fmtc.Errorf(\"Storage path %s does not exist\\n\", p.StoragePath))\n+\t}\n+\n+\tif !fsutil.IsWritable(p.StoragePath) {\n+\t\terrs = append(errs, fmtc.Errorf(\"Storage path %s is not writable\\n\", p.StoragePath))\n+\t}\n+\n+\treturn errs\n+}\n+\n+func New(configPath string) (*Preferences) {\n+\tcnf, err := knf.Read(configPath)\n+\n+\tif err != nil {\n+\t\tfmtc.Printf(err.Error())\n+\t\tos.Exit(1)\n+\t}\n+\n+\tp := &Preferences{\n+\t\tStorageURL: cnf.GetS(STORAGE_URL),\n+\t\tStoragePath: cnf.GetS(STORAGE_PATH),\n+\t}\n+\n+\treturn p","path":"prefs/prefs.go","position":null,"original_position":53,"commit_id":"f24dbac1bdb944e24ea33a05fdd8f945b58e4489","original_commit_id":"6f209bbe50aefb79df07b87471758daa67003afd","user":{"login":"gongled","id":2451611,"avatar_url":"https://avatars1.githubusercontent.com/u/2451611?v=3","gravatar_id":"","url":"https://api.github.com/users/gongled","html_url":"https://github.com/gongled","followers_url":"https://api.github.com/users/gongled/followers","following_url":"https://api.github.com/users/gongled/following{/other_user}","gists_url":"https://api.github.com/users/gongled/gists{/gist_id}","starred_url":"https://api.github.com/users/gongled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongled/subscriptions","organizations_url":"https://api.github.com/users/gongled/orgs","repos_url":"https://api.github.com/users/gongled/repos","events_url":"https://api.github.com/users/gongled/events{/privacy}","received_events_url":"https://api.github.com/users/gongled/received_events","type":"User","site_admin":false},"body":"Removed unnecessary `Preferences` struct. It is not relevant anymore.","created_at":"2017-05-17T19:24:38Z","updated_at":"2017-05-17T19:24:38Z","html_url":"https://github.com/gongled/vgrepo/pull/2#discussion_r117088793","pull_request_url":"https://api.github.com/repos/gongled/vgrepo/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/gongled/vgrepo/pulls/comments/117088793"},"html":{"href":"https://github.com/gongled/vgrepo/pull/2#discussion_r117088793"},"pull_request":{"href":"https://api.github.com/repos/gongled/vgrepo/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/gongled/vgrepo/pulls/2","id":121058804,"html_url":"https://github.com/gongled/vgrepo/pull/2","diff_url":"https://github.com/gongled/vgrepo/pull/2.diff","patch_url":"https://github.com/gongled/vgrepo/pull/2.patch","issue_url":"https://api.github.com/repos/gongled/vgrepo/issues/2","number":2,"state":"open","locked":false,"title":"Release v1.0.0","user":{"login":"gongled","id":2451611,"avatar_url":"https://avatars1.githubusercontent.com/u/2451611?v=3","gravatar_id":"","url":"https://api.github.com/users/gongled","html_url":"https://github.com/gongled","followers_url":"https://api.github.com/users/gongled/followers","following_url":"https://api.github.com/users/gongled/following{/other_user}","gists_url":"https://api.github.com/users/gongled/gists{/gist_id}","starred_url":"https://api.github.com/users/gongled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongled/subscriptions","organizations_url":"https://api.github.com/users/gongled/orgs","repos_url":"https://api.github.com/users/gongled/repos","events_url":"https://api.github.com/users/gongled/events{/privacy}","received_events_url":"https://api.github.com/users/gongled/received_events","type":"User","site_admin":false},"body":"Please have a look at my first software on Go programming language.","created_at":"2017-05-17T13:34:47Z","updated_at":"2017-05-17T19:24:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"911a78d78ee29d92dc5e9d58513638d6f727d492","assignee":{"login":"gongled","id":2451611,"avatar_url":"https://avatars1.githubusercontent.com/u/2451611?v=3","gravatar_id":"","url":"https://api.github.com/users/gongled","html_url":"https://github.com/gongled","followers_url":"https://api.github.com/users/gongled/followers","following_url":"https://api.github.com/users/gongled/following{/other_user}","gists_url":"https://api.github.com/users/gongled/gists{/gist_id}","starred_url":"https://api.github.com/users/gongled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongled/subscriptions","organizations_url":"https://api.github.com/users/gongled/orgs","repos_url":"https://api.github.com/users/gongled/repos","events_url":"https://api.github.com/users/gongled/events{/privacy}","received_events_url":"https://api.github.com/users/gongled/received_events","type":"User","site_admin":false},"assignees":[{"login":"gongled","id":2451611,"avatar_url":"https://avatars1.githubusercontent.com/u/2451611?v=3","gravatar_id":"","url":"https://api.github.com/users/gongled","html_url":"https://github.com/gongled","followers_url":"https://api.github.com/users/gongled/followers","following_url":"https://api.github.com/users/gongled/following{/other_user}","gists_url":"https://api.github.com/users/gongled/gists{/gist_id}","starred_url":"https://api.github.com/users/gongled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongled/subscriptions","organizations_url":"https://api.github.com/users/gongled/orgs","repos_url":"https://api.github.com/users/gongled/repos","events_url":"https://api.github.com/users/gongled/events{/privacy}","received_events_url":"https://api.github.com/users/gongled/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/gongled/vgrepo/milestones/1","html_url":"https://github.com/gongled/vgrepo/milestone/1","labels_url":"https://api.github.com/repos/gongled/vgrepo/milestones/1/labels","id":2526847,"number":1,"title":"Release v1.0.0","description":"","creator":{"login":"gongled","id":2451611,"avatar_url":"https://avatars1.githubusercontent.com/u/2451611?v=3","gravatar_id":"","url":"https://api.github.com/users/gongled","html_url":"https://github.com/gongled","followers_url":"https://api.github.com/users/gongled/followers","following_url":"https://api.github.com/users/gongled/following{/other_user}","gists_url":"https://api.github.com/users/gongled/gists{/gist_id}","starred_url":"https://api.github.com/users/gongled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongled/subscriptions","organizations_url":"https://api.github.com/users/gongled/orgs","repos_url":"https://api.github.com/users/gongled/repos","events_url":"https://api.github.com/users/gongled/events{/privacy}","received_events_url":"https://api.github.com/users/gongled/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":1,"state":"open","created_at":"2017-05-17T13:26:34Z","updated_at":"2017-05-17T13:34:47Z","due_on":"2017-06-30T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/gongled/vgrepo/pulls/2/commits","review_comments_url":"https://api.github.com/repos/gongled/vgrepo/pulls/2/comments","review_comment_url":"https://api.github.com/repos/gongled/vgrepo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gongled/vgrepo/issues/2/comments","statuses_url":"https://api.github.com/repos/gongled/vgrepo/statuses/f24dbac1bdb944e24ea33a05fdd8f945b58e4489","head":{"label":"gongled:develop","ref":"develop","sha":"f24dbac1bdb944e24ea33a05fdd8f945b58e4489","user":{"login":"gongled","id":2451611,"avatar_url":"https://avatars1.githubusercontent.com/u/2451611?v=3","gravatar_id":"","url":"https://api.github.com/users/gongled","html_url":"https://github.com/gongled","followers_url":"https://api.github.com/users/gongled/followers","following_url":"https://api.github.com/users/gongled/following{/other_user}","gists_url":"https://api.github.com/users/gongled/gists{/gist_id}","starred_url":"https://api.github.com/users/gongled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongled/subscriptions","organizations_url":"https://api.github.com/users/gongled/orgs","repos_url":"https://api.github.com/users/gongled/repos","events_url":"https://api.github.com/users/gongled/events{/privacy}","received_events_url":"https://api.github.com/users/gongled/received_events","type":"User","site_admin":false},"repo":{"id":91578708,"name":"vgrepo","full_name":"gongled/vgrepo","owner":{"login":"gongled","id":2451611,"avatar_url":"https://avatars1.githubusercontent.com/u/2451611?v=3","gravatar_id":"","url":"https://api.github.com/users/gongled","html_url":"https://github.com/gongled","followers_url":"https://api.github.com/users/gongled/followers","following_url":"https://api.github.com/users/gongled/following{/other_user}","gists_url":"https://api.github.com/users/gongled/gists{/gist_id}","starred_url":"https://api.github.com/users/gongled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongled/subscriptions","organizations_url":"https://api.github.com/users/gongled/orgs","repos_url":"https://api.github.com/users/gongled/repos","events_url":"https://api.github.com/users/gongled/events{/privacy}","received_events_url":"https://api.github.com/users/gongled/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gongled/vgrepo","description":"Simple CLI tool for managing Vagrant repositories","fork":false,"url":"https://api.github.com/repos/gongled/vgrepo","forks_url":"https://api.github.com/repos/gongled/vgrepo/forks","keys_url":"https://api.github.com/repos/gongled/vgrepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gongled/vgrepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gongled/vgrepo/teams","hooks_url":"https://api.github.com/repos/gongled/vgrepo/hooks","issue_events_url":"https://api.github.com/repos/gongled/vgrepo/issues/events{/number}","events_url":"https://api.github.com/repos/gongled/vgrepo/events","assignees_url":"https://api.github.com/repos/gongled/vgrepo/assignees{/user}","branches_url":"https://api.github.com/repos/gongled/vgrepo/branches{/branch}","tags_url":"https://api.github.com/repos/gongled/vgrepo/tags","blobs_url":"https://api.github.com/repos/gongled/vgrepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gongled/vgrepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gongled/vgrepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/gongled/vgrepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gongled/vgrepo/statuses/{sha}","languages_url":"https://api.github.com/repos/gongled/vgrepo/languages","stargazers_url":"https://api.github.com/repos/gongled/vgrepo/stargazers","contributors_url":"https://api.github.com/repos/gongled/vgrepo/contributors","subscribers_url":"https://api.github.com/repos/gongled/vgrepo/subscribers","subscription_url":"https://api.github.com/repos/gongled/vgrepo/subscription","commits_url":"https://api.github.com/repos/gongled/vgrepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/gongled/vgrepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/gongled/vgrepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/gongled/vgrepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/gongled/vgrepo/contents/{+path}","compare_url":"https://api.github.com/repos/gongled/vgrepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gongled/vgrepo/merges","archive_url":"https://api.github.com/repos/gongled/vgrepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gongled/vgrepo/downloads","issues_url":"https://api.github.com/repos/gongled/vgrepo/issues{/number}","pulls_url":"https://api.github.com/repos/gongled/vgrepo/pulls{/number}","milestones_url":"https://api.github.com/repos/gongled/vgrepo/milestones{/number}","notifications_url":"https://api.github.com/repos/gongled/vgrepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gongled/vgrepo/labels{/name}","releases_url":"https://api.github.com/repos/gongled/vgrepo/releases{/id}","deployments_url":"https://api.github.com/repos/gongled/vgrepo/deployments","created_at":"2017-05-17T13:19:28Z","updated_at":"2017-05-17T13:33:00Z","pushed_at":"2017-05-17T19:20:37Z","git_url":"git://github.com/gongled/vgrepo.git","ssh_url":"git@github.com:gongled/vgrepo.git","clone_url":"https://github.com/gongled/vgrepo.git","svn_url":"https://github.com/gongled/vgrepo","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":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":"gongled:master","ref":"master","sha":"ba09bed74a1e39e9dc57d0a694382eddf3bbf2ed","user":{"login":"gongled","id":2451611,"avatar_url":"https://avatars1.githubusercontent.com/u/2451611?v=3","gravatar_id":"","url":"https://api.github.com/users/gongled","html_url":"https://github.com/gongled","followers_url":"https://api.github.com/users/gongled/followers","following_url":"https://api.github.com/users/gongled/following{/other_user}","gists_url":"https://api.github.com/users/gongled/gists{/gist_id}","starred_url":"https://api.github.com/users/gongled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongled/subscriptions","organizations_url":"https://api.github.com/users/gongled/orgs","repos_url":"https://api.github.com/users/gongled/repos","events_url":"https://api.github.com/users/gongled/events{/privacy}","received_events_url":"https://api.github.com/users/gongled/received_events","type":"User","site_admin":false},"repo":{"id":91578708,"name":"vgrepo","full_name":"gongled/vgrepo","owner":{"login":"gongled","id":2451611,"avatar_url":"https://avatars1.githubusercontent.com/u/2451611?v=3","gravatar_id":"","url":"https://api.github.com/users/gongled","html_url":"https://github.com/gongled","followers_url":"https://api.github.com/users/gongled/followers","following_url":"https://api.github.com/users/gongled/following{/other_user}","gists_url":"https://api.github.com/users/gongled/gists{/gist_id}","starred_url":"https://api.github.com/users/gongled/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gongled/subscriptions","organizations_url":"https://api.github.com/users/gongled/orgs","repos_url":"https://api.github.com/users/gongled/repos","events_url":"https://api.github.com/users/gongled/events{/privacy}","received_events_url":"https://api.github.com/users/gongled/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gongled/vgrepo","description":"Simple CLI tool for managing Vagrant repositories","fork":false,"url":"https://api.github.com/repos/gongled/vgrepo","forks_url":"https://api.github.com/repos/gongled/vgrepo/forks","keys_url":"https://api.github.com/repos/gongled/vgrepo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gongled/vgrepo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gongled/vgrepo/teams","hooks_url":"https://api.github.com/repos/gongled/vgrepo/hooks","issue_events_url":"https://api.github.com/repos/gongled/vgrepo/issues/events{/number}","events_url":"https://api.github.com/repos/gongled/vgrepo/events","assignees_url":"https://api.github.com/repos/gongled/vgrepo/assignees{/user}","branches_url":"https://api.github.com/repos/gongled/vgrepo/branches{/branch}","tags_url":"https://api.github.com/repos/gongled/vgrepo/tags","blobs_url":"https://api.github.com/repos/gongled/vgrepo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gongled/vgrepo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gongled/vgrepo/git/refs{/sha}","trees_url":"https://api.github.com/repos/gongled/vgrepo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gongled/vgrepo/statuses/{sha}","languages_url":"https://api.github.com/repos/gongled/vgrepo/languages","stargazers_url":"https://api.github.com/repos/gongled/vgrepo/stargazers","contributors_url":"https://api.github.com/repos/gongled/vgrepo/contributors","subscribers_url":"https://api.github.com/repos/gongled/vgrepo/subscribers","subscription_url":"https://api.github.com/repos/gongled/vgrepo/subscription","commits_url":"https://api.github.com/repos/gongled/vgrepo/commits{/sha}","git_commits_url":"https://api.github.com/repos/gongled/vgrepo/git/commits{/sha}","comments_url":"https://api.github.com/repos/gongled/vgrepo/comments{/number}","issue_comment_url":"https://api.github.com/repos/gongled/vgrepo/issues/comments{/number}","contents_url":"https://api.github.com/repos/gongled/vgrepo/contents/{+path}","compare_url":"https://api.github.com/repos/gongled/vgrepo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gongled/vgrepo/merges","archive_url":"https://api.github.com/repos/gongled/vgrepo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gongled/vgrepo/downloads","issues_url":"https://api.github.com/repos/gongled/vgrepo/issues{/number}","pulls_url":"https://api.github.com/repos/gongled/vgrepo/pulls{/number}","milestones_url":"https://api.github.com/repos/gongled/vgrepo/milestones{/number}","notifications_url":"https://api.github.com/repos/gongled/vgrepo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gongled/vgrepo/labels{/name}","releases_url":"https://api.github.com/repos/gongled/vgrepo/releases{/id}","deployments_url":"https://api.github.com/repos/gongled/vgrepo/deployments","created_at":"2017-05-17T13:19:28Z","updated_at":"2017-05-17T13:33:00Z","pushed_at":"2017-05-17T19:20:37Z","git_url":"git://github.com/gongled/vgrepo.git","ssh_url":"git@github.com:gongled/vgrepo.git","clone_url":"https://github.com/gongled/vgrepo.git","svn_url":"https://github.com/gongled/vgrepo","homepage":null,"size":14,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":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/gongled/vgrepo/pulls/2"},"html":{"href":"https://github.com/gongled/vgrepo/pull/2"},"issue":{"href":"https://api.github.com/repos/gongled/vgrepo/issues/2"},"comments":{"href":"https://api.github.com/repos/gongled/vgrepo/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/gongled/vgrepo/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/gongled/vgrepo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gongled/vgrepo/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/gongled/vgrepo/statuses/f24dbac1bdb944e24ea33a05fdd8f945b58e4489"}}}}
{"actor":{"display_login":"gongled"}}