{"action":"created","comment":{"url":"https://api.github.com/repos/u-root/u-root/pulls/comments/174373173","pull_request_review_id":103714730,"id":174373173,"diff_hunk":"@@ -48,7 +75,11 @@ func main() {\n \tif *ro {\n \t\tflags |= unix.MS_RDONLY\n \t}\n-\tif err := unix.Mount(a[0], a[1], *fsType, flags, strings.Join(data, \",\")); err != nil {\n+\tif *fsType == \"\" {\n+\t\tlog.Printf(\"No file system type provided!\\n\")\n+\t\tlog.Fatalf(\"Usage: mount [-r] [-o mount options] -t fstype dev path\")\n+\t} else if err := unix.Mount(a[0], a[1], *fsType, flags, strings.Join(data, \",\")); err != nil {","path":"cmds/mount/mount.go","position":60,"original_position":60,"commit_id":"fc24fe4143e486106fa5a81b10a1aeb9e5440b50","original_commit_id":"fc24fe4143e486106fa5a81b10a1aeb9e5440b50","user":{"login":"fozog","id":11852428,"avatar_url":"https://avatars0.githubusercontent.com/u/11852428?v=4","gravatar_id":"","url":"https://api.github.com/users/fozog","html_url":"https://github.com/fozog","followers_url":"https://api.github.com/users/fozog/followers","following_url":"https://api.github.com/users/fozog/following{/other_user}","gists_url":"https://api.github.com/users/fozog/gists{/gist_id}","starred_url":"https://api.github.com/users/fozog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fozog/subscriptions","organizations_url":"https://api.github.com/users/fozog/orgs","repos_url":"https://api.github.com/users/fozog/repos","events_url":"https://api.github.com/users/fozog/events{/privacy}","received_events_url":"https://api.github.com/users/fozog/received_events","type":"User","site_admin":false},"body":"The code you point to is verification that a -t has been supplied by the user. so that is a check before.\r\n\r\nI shall do things differently in the part that actually document the error.\r\nMy business space is embedded so boot time is important (you don't want to wait for your rear camera when you start your car and want to backup).\r\nEven this is little work, I don't want checks to slow down regular work programmed in script because I want to help users.\r\nSo, as a \"philosophy\" I prefer to do \"post-portem\" documentation rather than screening things at the beginning. Except if checks are here to prevent harm of the command to be executed.\r\n\r\nIf you agree, I'll propose a different way to document the error after it happens.\r\n\r\n","created_at":"2018-03-14T07:42:56Z","updated_at":"2018-03-14T07:42:56Z","html_url":"https://github.com/u-root/u-root/pull/675#discussion_r174373173","pull_request_url":"https://api.github.com/repos/u-root/u-root/pulls/675","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/u-root/u-root/pulls/comments/174373173"},"html":{"href":"https://github.com/u-root/u-root/pull/675#discussion_r174373173"},"pull_request":{"href":"https://api.github.com/repos/u-root/u-root/pulls/675"}},"in_reply_to_id":174275985},"pull_request":{"url":"https://api.github.com/repos/u-root/u-root/pulls/675","id":174738051,"html_url":"https://github.com/u-root/u-root/pull/675","diff_url":"https://github.com/u-root/u-root/pull/675.diff","patch_url":"https://github.com/u-root/u-root/pull/675.patch","issue_url":"https://api.github.com/repos/u-root/u-root/issues/675","number":675,"state":"open","locked":false,"title":"cmds/mount: change usage/error reporting","user":{"login":"fozog","id":11852428,"avatar_url":"https://avatars0.githubusercontent.com/u/11852428?v=4","gravatar_id":"","url":"https://api.github.com/users/fozog","html_url":"https://github.com/fozog","followers_url":"https://api.github.com/users/fozog/followers","following_url":"https://api.github.com/users/fozog/following{/other_user}","gists_url":"https://api.github.com/users/fozog/gists{/gist_id}","starred_url":"https://api.github.com/users/fozog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fozog/subscriptions","organizations_url":"https://api.github.com/users/fozog/orgs","repos_url":"https://api.github.com/users/fozog/repos","events_url":"https://api.github.com/users/fozog/events{/privacy}","received_events_url":"https://api.github.com/users/fozog/received_events","type":"User","site_admin":false},"body":"changed usage string to reflect exact rules\r\ninform user if filesystem type not supported","created_at":"2018-03-13T17:41:51Z","updated_at":"2018-03-14T07:42:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6fcdba94ae54eae5fa05b2e7ed82a8b02aecd5d3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/u-root/u-root/pulls/675/commits","review_comments_url":"https://api.github.com/repos/u-root/u-root/pulls/675/comments","review_comment_url":"https://api.github.com/repos/u-root/u-root/pulls/comments{/number}","comments_url":"https://api.github.com/repos/u-root/u-root/issues/675/comments","statuses_url":"https://api.github.com/repos/u-root/u-root/statuses/fc24fe4143e486106fa5a81b10a1aeb9e5440b50","head":{"label":"fozog:master","ref":"master","sha":"fc24fe4143e486106fa5a81b10a1aeb9e5440b50","user":{"login":"fozog","id":11852428,"avatar_url":"https://avatars0.githubusercontent.com/u/11852428?v=4","gravatar_id":"","url":"https://api.github.com/users/fozog","html_url":"https://github.com/fozog","followers_url":"https://api.github.com/users/fozog/followers","following_url":"https://api.github.com/users/fozog/following{/other_user}","gists_url":"https://api.github.com/users/fozog/gists{/gist_id}","starred_url":"https://api.github.com/users/fozog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fozog/subscriptions","organizations_url":"https://api.github.com/users/fozog/orgs","repos_url":"https://api.github.com/users/fozog/repos","events_url":"https://api.github.com/users/fozog/events{/privacy}","received_events_url":"https://api.github.com/users/fozog/received_events","type":"User","site_admin":false},"repo":{"id":125084569,"name":"u-root","full_name":"fozog/u-root","owner":{"login":"fozog","id":11852428,"avatar_url":"https://avatars0.githubusercontent.com/u/11852428?v=4","gravatar_id":"","url":"https://api.github.com/users/fozog","html_url":"https://github.com/fozog","followers_url":"https://api.github.com/users/fozog/followers","following_url":"https://api.github.com/users/fozog/following{/other_user}","gists_url":"https://api.github.com/users/fozog/gists{/gist_id}","starred_url":"https://api.github.com/users/fozog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fozog/subscriptions","organizations_url":"https://api.github.com/users/fozog/orgs","repos_url":"https://api.github.com/users/fozog/repos","events_url":"https://api.github.com/users/fozog/events{/privacy}","received_events_url":"https://api.github.com/users/fozog/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fozog/u-root","description":"A universal root: u-root creates a root file system (initramfs) containing a busybox-like set of tools in Go.","fork":true,"url":"https://api.github.com/repos/fozog/u-root","forks_url":"https://api.github.com/repos/fozog/u-root/forks","keys_url":"https://api.github.com/repos/fozog/u-root/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fozog/u-root/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fozog/u-root/teams","hooks_url":"https://api.github.com/repos/fozog/u-root/hooks","issue_events_url":"https://api.github.com/repos/fozog/u-root/issues/events{/number}","events_url":"https://api.github.com/repos/fozog/u-root/events","assignees_url":"https://api.github.com/repos/fozog/u-root/assignees{/user}","branches_url":"https://api.github.com/repos/fozog/u-root/branches{/branch}","tags_url":"https://api.github.com/repos/fozog/u-root/tags","blobs_url":"https://api.github.com/repos/fozog/u-root/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fozog/u-root/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fozog/u-root/git/refs{/sha}","trees_url":"https://api.github.com/repos/fozog/u-root/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fozog/u-root/statuses/{sha}","languages_url":"https://api.github.com/repos/fozog/u-root/languages","stargazers_url":"https://api.github.com/repos/fozog/u-root/stargazers","contributors_url":"https://api.github.com/repos/fozog/u-root/contributors","subscribers_url":"https://api.github.com/repos/fozog/u-root/subscribers","subscription_url":"https://api.github.com/repos/fozog/u-root/subscription","commits_url":"https://api.github.com/repos/fozog/u-root/commits{/sha}","git_commits_url":"https://api.github.com/repos/fozog/u-root/git/commits{/sha}","comments_url":"https://api.github.com/repos/fozog/u-root/comments{/number}","issue_comment_url":"https://api.github.com/repos/fozog/u-root/issues/comments{/number}","contents_url":"https://api.github.com/repos/fozog/u-root/contents/{+path}","compare_url":"https://api.github.com/repos/fozog/u-root/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fozog/u-root/merges","archive_url":"https://api.github.com/repos/fozog/u-root/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fozog/u-root/downloads","issues_url":"https://api.github.com/repos/fozog/u-root/issues{/number}","pulls_url":"https://api.github.com/repos/fozog/u-root/pulls{/number}","milestones_url":"https://api.github.com/repos/fozog/u-root/milestones{/number}","notifications_url":"https://api.github.com/repos/fozog/u-root/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fozog/u-root/labels{/name}","releases_url":"https://api.github.com/repos/fozog/u-root/releases{/id}","deployments_url":"https://api.github.com/repos/fozog/u-root/deployments","created_at":"2018-03-13T16:49:15Z","updated_at":"2018-03-13T19:24:19Z","pushed_at":"2018-03-13T19:24:17Z","git_url":"git://github.com/fozog/u-root.git","ssh_url":"git@github.com:fozog/u-root.git","clone_url":"https://github.com/fozog/u-root.git","svn_url":"https://github.com/fozog/u-root","homepage":"http://u-root.tk","size":32243,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"u-root:master","ref":"master","sha":"6b806e38ffbd4e3adb465050fe7450d3cd178e62","user":{"login":"u-root","id":13317538,"avatar_url":"https://avatars3.githubusercontent.com/u/13317538?v=4","gravatar_id":"","url":"https://api.github.com/users/u-root","html_url":"https://github.com/u-root","followers_url":"https://api.github.com/users/u-root/followers","following_url":"https://api.github.com/users/u-root/following{/other_user}","gists_url":"https://api.github.com/users/u-root/gists{/gist_id}","starred_url":"https://api.github.com/users/u-root/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u-root/subscriptions","organizations_url":"https://api.github.com/users/u-root/orgs","repos_url":"https://api.github.com/users/u-root/repos","events_url":"https://api.github.com/users/u-root/events{/privacy}","received_events_url":"https://api.github.com/users/u-root/received_events","type":"Organization","site_admin":false},"repo":{"id":46462030,"name":"u-root","full_name":"u-root/u-root","owner":{"login":"u-root","id":13317538,"avatar_url":"https://avatars3.githubusercontent.com/u/13317538?v=4","gravatar_id":"","url":"https://api.github.com/users/u-root","html_url":"https://github.com/u-root","followers_url":"https://api.github.com/users/u-root/followers","following_url":"https://api.github.com/users/u-root/following{/other_user}","gists_url":"https://api.github.com/users/u-root/gists{/gist_id}","starred_url":"https://api.github.com/users/u-root/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u-root/subscriptions","organizations_url":"https://api.github.com/users/u-root/orgs","repos_url":"https://api.github.com/users/u-root/repos","events_url":"https://api.github.com/users/u-root/events{/privacy}","received_events_url":"https://api.github.com/users/u-root/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/u-root/u-root","description":"A universal root: u-root creates a root file system (initramfs) containing a busybox-like set of tools in Go.","fork":false,"url":"https://api.github.com/repos/u-root/u-root","forks_url":"https://api.github.com/repos/u-root/u-root/forks","keys_url":"https://api.github.com/repos/u-root/u-root/keys{/key_id}","collaborators_url":"https://api.github.com/repos/u-root/u-root/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/u-root/u-root/teams","hooks_url":"https://api.github.com/repos/u-root/u-root/hooks","issue_events_url":"https://api.github.com/repos/u-root/u-root/issues/events{/number}","events_url":"https://api.github.com/repos/u-root/u-root/events","assignees_url":"https://api.github.com/repos/u-root/u-root/assignees{/user}","branches_url":"https://api.github.com/repos/u-root/u-root/branches{/branch}","tags_url":"https://api.github.com/repos/u-root/u-root/tags","blobs_url":"https://api.github.com/repos/u-root/u-root/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/u-root/u-root/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/u-root/u-root/git/refs{/sha}","trees_url":"https://api.github.com/repos/u-root/u-root/git/trees{/sha}","statuses_url":"https://api.github.com/repos/u-root/u-root/statuses/{sha}","languages_url":"https://api.github.com/repos/u-root/u-root/languages","stargazers_url":"https://api.github.com/repos/u-root/u-root/stargazers","contributors_url":"https://api.github.com/repos/u-root/u-root/contributors","subscribers_url":"https://api.github.com/repos/u-root/u-root/subscribers","subscription_url":"https://api.github.com/repos/u-root/u-root/subscription","commits_url":"https://api.github.com/repos/u-root/u-root/commits{/sha}","git_commits_url":"https://api.github.com/repos/u-root/u-root/git/commits{/sha}","comments_url":"https://api.github.com/repos/u-root/u-root/comments{/number}","issue_comment_url":"https://api.github.com/repos/u-root/u-root/issues/comments{/number}","contents_url":"https://api.github.com/repos/u-root/u-root/contents/{+path}","compare_url":"https://api.github.com/repos/u-root/u-root/compare/{base}...{head}","merges_url":"https://api.github.com/repos/u-root/u-root/merges","archive_url":"https://api.github.com/repos/u-root/u-root/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/u-root/u-root/downloads","issues_url":"https://api.github.com/repos/u-root/u-root/issues{/number}","pulls_url":"https://api.github.com/repos/u-root/u-root/pulls{/number}","milestones_url":"https://api.github.com/repos/u-root/u-root/milestones{/number}","notifications_url":"https://api.github.com/repos/u-root/u-root/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/u-root/u-root/labels{/name}","releases_url":"https://api.github.com/repos/u-root/u-root/releases{/id}","deployments_url":"https://api.github.com/repos/u-root/u-root/deployments","created_at":"2015-11-19T02:28:59Z","updated_at":"2018-03-13T23:02:44Z","pushed_at":"2018-03-14T00:30:50Z","git_url":"git://github.com/u-root/u-root.git","ssh_url":"git@github.com:u-root/u-root.git","clone_url":"https://github.com/u-root/u-root.git","svn_url":"https://github.com/u-root/u-root","homepage":"http://u-root.tk","size":33460,"stargazers_count":512,"watchers_count":512,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":76,"mirror_url":null,"archived":false,"open_issues_count":87,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":76,"open_issues":87,"watchers":512,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/u-root/u-root/pulls/675"},"html":{"href":"https://github.com/u-root/u-root/pull/675"},"issue":{"href":"https://api.github.com/repos/u-root/u-root/issues/675"},"comments":{"href":"https://api.github.com/repos/u-root/u-root/issues/675/comments"},"review_comments":{"href":"https://api.github.com/repos/u-root/u-root/pulls/675/comments"},"review_comment":{"href":"https://api.github.com/repos/u-root/u-root/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/u-root/u-root/pulls/675/commits"},"statuses":{"href":"https://api.github.com/repos/u-root/u-root/statuses/fc24fe4143e486106fa5a81b10a1aeb9e5440b50"}},"author_association":"NONE"}}
{"actor":{"display_login":"fozog"}}