{"action":"created","comment":{"url":"https://api.github.com/repos/coreos/go-systemd/pulls/comments/48091687","id":48091687,"diff_hunk":"@@ -254,3 +255,19 @@ func IsRunningSystemd() bool {\n \t}\n \treturn fi.IsDir()\n }\n+\n+// GetMachineID returns a host's 128-bit machine ID as a string.\n+func GetMachineID() (machineID string, err error) {","path":"util/util.go","position":14,"original_position":14,"commit_id":"e9e7fcbb50d8ee180e220c8585ff612e1880ddc7","original_commit_id":"e9e7fcbb50d8ee180e220c8585ff612e1880ddc7","user":{"login":"jonboulle","id":2601015,"avatar_url":"https://avatars.githubusercontent.com/u/2601015?v=3","gravatar_id":"","url":"https://api.github.com/users/jonboulle","html_url":"https://github.com/jonboulle","followers_url":"https://api.github.com/users/jonboulle/followers","following_url":"https://api.github.com/users/jonboulle/following{/other_user}","gists_url":"https://api.github.com/users/jonboulle/gists{/gist_id}","starred_url":"https://api.github.com/users/jonboulle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonboulle/subscriptions","organizations_url":"https://api.github.com/users/jonboulle/orgs","repos_url":"https://api.github.com/users/jonboulle/repos","events_url":"https://api.github.com/users/jonboulle/events{/privacy}","received_events_url":"https://api.github.com/users/jonboulle/received_events","type":"User","site_admin":false},"body":"A few style nits for this function:\r\na) I'd omit the named result parameters - they add little value and it stutters a bit in godoc\r\nb) Error strings should start [lower-case](https://github.com/golang/go/wiki/CodeReviewComments#error-strings)\r\nb) I would rather promote the comment to the docstring, similar to that of `IsRunningSystemd`, e.g.: \"This functions similar to systemd's `sd_id28_get_machine`, ...\" \r\nc) Let's just `strings.TrimSpace` instead of manual string slicing","created_at":"2015-12-19T12:01:26Z","updated_at":"2015-12-19T12:01:26Z","html_url":"https://github.com/coreos/go-systemd/pull/128#discussion_r48091687","pull_request_url":"https://api.github.com/repos/coreos/go-systemd/pulls/128","_links":{"self":{"href":"https://api.github.com/repos/coreos/go-systemd/pulls/comments/48091687"},"html":{"href":"https://github.com/coreos/go-systemd/pull/128#discussion_r48091687"},"pull_request":{"href":"https://api.github.com/repos/coreos/go-systemd/pulls/128"}}},"pull_request":{"url":"https://api.github.com/repos/coreos/go-systemd/pulls/128","id":54170190,"html_url":"https://github.com/coreos/go-systemd/pull/128","diff_url":"https://github.com/coreos/go-systemd/pull/128.diff","patch_url":"https://github.com/coreos/go-systemd/pull/128.patch","issue_url":"https://api.github.com/repos/coreos/go-systemd/issues/128","number":128,"state":"open","locked":false,"title":"Enable reading of the journal from a custom directory","user":{"login":"chrissnell","id":1072626,"avatar_url":"https://avatars.githubusercontent.com/u/1072626?v=3","gravatar_id":"","url":"https://api.github.com/users/chrissnell","html_url":"https://github.com/chrissnell","followers_url":"https://api.github.com/users/chrissnell/followers","following_url":"https://api.github.com/users/chrissnell/following{/other_user}","gists_url":"https://api.github.com/users/chrissnell/gists{/gist_id}","starred_url":"https://api.github.com/users/chrissnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrissnell/subscriptions","organizations_url":"https://api.github.com/users/chrissnell/orgs","repos_url":"https://api.github.com/users/chrissnell/repos","events_url":"https://api.github.com/users/chrissnell/events{/privacy}","received_events_url":"https://api.github.com/users/chrissnell/received_events","type":"User","site_admin":false},"body":"This PR enables the user to read the system journal from a custom (alternate) directory by offering an interface to the ```sd_journal_open_directory()``` function.\r\n\r\nIt also adds a ```GetMachineID()``` convenience function, useful for typical journald storage directories that include the machine-id in the path.","created_at":"2015-12-19T03:31:04Z","updated_at":"2015-12-19T12:01:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d8ae26a09f8c8966d271141287b7a4b25637a6c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/coreos/go-systemd/pulls/128/commits","review_comments_url":"https://api.github.com/repos/coreos/go-systemd/pulls/128/comments","review_comment_url":"https://api.github.com/repos/coreos/go-systemd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coreos/go-systemd/issues/128/comments","statuses_url":"https://api.github.com/repos/coreos/go-systemd/statuses/e9e7fcbb50d8ee180e220c8585ff612e1880ddc7","head":{"label":"chrissnell:custom-journal-directory","ref":"custom-journal-directory","sha":"e9e7fcbb50d8ee180e220c8585ff612e1880ddc7","user":{"login":"chrissnell","id":1072626,"avatar_url":"https://avatars.githubusercontent.com/u/1072626?v=3","gravatar_id":"","url":"https://api.github.com/users/chrissnell","html_url":"https://github.com/chrissnell","followers_url":"https://api.github.com/users/chrissnell/followers","following_url":"https://api.github.com/users/chrissnell/following{/other_user}","gists_url":"https://api.github.com/users/chrissnell/gists{/gist_id}","starred_url":"https://api.github.com/users/chrissnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrissnell/subscriptions","organizations_url":"https://api.github.com/users/chrissnell/orgs","repos_url":"https://api.github.com/users/chrissnell/repos","events_url":"https://api.github.com/users/chrissnell/events{/privacy}","received_events_url":"https://api.github.com/users/chrissnell/received_events","type":"User","site_admin":false},"repo":{"id":48266972,"name":"go-systemd","full_name":"chrissnell/go-systemd","owner":{"login":"chrissnell","id":1072626,"avatar_url":"https://avatars.githubusercontent.com/u/1072626?v=3","gravatar_id":"","url":"https://api.github.com/users/chrissnell","html_url":"https://github.com/chrissnell","followers_url":"https://api.github.com/users/chrissnell/followers","following_url":"https://api.github.com/users/chrissnell/following{/other_user}","gists_url":"https://api.github.com/users/chrissnell/gists{/gist_id}","starred_url":"https://api.github.com/users/chrissnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrissnell/subscriptions","organizations_url":"https://api.github.com/users/chrissnell/orgs","repos_url":"https://api.github.com/users/chrissnell/repos","events_url":"https://api.github.com/users/chrissnell/events{/privacy}","received_events_url":"https://api.github.com/users/chrissnell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chrissnell/go-systemd","description":"Go bindings to systemd socket activation, journal, D-Bus, and unit files","fork":true,"url":"https://api.github.com/repos/chrissnell/go-systemd","forks_url":"https://api.github.com/repos/chrissnell/go-systemd/forks","keys_url":"https://api.github.com/repos/chrissnell/go-systemd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chrissnell/go-systemd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chrissnell/go-systemd/teams","hooks_url":"https://api.github.com/repos/chrissnell/go-systemd/hooks","issue_events_url":"https://api.github.com/repos/chrissnell/go-systemd/issues/events{/number}","events_url":"https://api.github.com/repos/chrissnell/go-systemd/events","assignees_url":"https://api.github.com/repos/chrissnell/go-systemd/assignees{/user}","branches_url":"https://api.github.com/repos/chrissnell/go-systemd/branches{/branch}","tags_url":"https://api.github.com/repos/chrissnell/go-systemd/tags","blobs_url":"https://api.github.com/repos/chrissnell/go-systemd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chrissnell/go-systemd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chrissnell/go-systemd/git/refs{/sha}","trees_url":"https://api.github.com/repos/chrissnell/go-systemd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chrissnell/go-systemd/statuses/{sha}","languages_url":"https://api.github.com/repos/chrissnell/go-systemd/languages","stargazers_url":"https://api.github.com/repos/chrissnell/go-systemd/stargazers","contributors_url":"https://api.github.com/repos/chrissnell/go-systemd/contributors","subscribers_url":"https://api.github.com/repos/chrissnell/go-systemd/subscribers","subscription_url":"https://api.github.com/repos/chrissnell/go-systemd/subscription","commits_url":"https://api.github.com/repos/chrissnell/go-systemd/commits{/sha}","git_commits_url":"https://api.github.com/repos/chrissnell/go-systemd/git/commits{/sha}","comments_url":"https://api.github.com/repos/chrissnell/go-systemd/comments{/number}","issue_comment_url":"https://api.github.com/repos/chrissnell/go-systemd/issues/comments{/number}","contents_url":"https://api.github.com/repos/chrissnell/go-systemd/contents/{+path}","compare_url":"https://api.github.com/repos/chrissnell/go-systemd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chrissnell/go-systemd/merges","archive_url":"https://api.github.com/repos/chrissnell/go-systemd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chrissnell/go-systemd/downloads","issues_url":"https://api.github.com/repos/chrissnell/go-systemd/issues{/number}","pulls_url":"https://api.github.com/repos/chrissnell/go-systemd/pulls{/number}","milestones_url":"https://api.github.com/repos/chrissnell/go-systemd/milestones{/number}","notifications_url":"https://api.github.com/repos/chrissnell/go-systemd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chrissnell/go-systemd/labels{/name}","releases_url":"https://api.github.com/repos/chrissnell/go-systemd/releases{/id}","created_at":"2015-12-19T03:24:19Z","updated_at":"2015-12-19T03:24:19Z","pushed_at":"2015-12-19T06:56:28Z","git_url":"git://github.com/chrissnell/go-systemd.git","ssh_url":"git@github.com:chrissnell/go-systemd.git","clone_url":"https://github.com/chrissnell/go-systemd.git","svn_url":"https://github.com/chrissnell/go-systemd","homepage":"","size":256,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"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":"coreos:master","ref":"master","sha":"a831f36d09de8f095c28eeee839df52e9de5031f","user":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"repo":{"id":12821303,"name":"go-systemd","full_name":"coreos/go-systemd","owner":{"login":"coreos","id":3730757,"avatar_url":"https://avatars.githubusercontent.com/u/3730757?v=3","gravatar_id":"","url":"https://api.github.com/users/coreos","html_url":"https://github.com/coreos","followers_url":"https://api.github.com/users/coreos/followers","following_url":"https://api.github.com/users/coreos/following{/other_user}","gists_url":"https://api.github.com/users/coreos/gists{/gist_id}","starred_url":"https://api.github.com/users/coreos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coreos/subscriptions","organizations_url":"https://api.github.com/users/coreos/orgs","repos_url":"https://api.github.com/users/coreos/repos","events_url":"https://api.github.com/users/coreos/events{/privacy}","received_events_url":"https://api.github.com/users/coreos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coreos/go-systemd","description":"Go bindings to systemd socket activation, journal, D-Bus, and unit files","fork":false,"url":"https://api.github.com/repos/coreos/go-systemd","forks_url":"https://api.github.com/repos/coreos/go-systemd/forks","keys_url":"https://api.github.com/repos/coreos/go-systemd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coreos/go-systemd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coreos/go-systemd/teams","hooks_url":"https://api.github.com/repos/coreos/go-systemd/hooks","issue_events_url":"https://api.github.com/repos/coreos/go-systemd/issues/events{/number}","events_url":"https://api.github.com/repos/coreos/go-systemd/events","assignees_url":"https://api.github.com/repos/coreos/go-systemd/assignees{/user}","branches_url":"https://api.github.com/repos/coreos/go-systemd/branches{/branch}","tags_url":"https://api.github.com/repos/coreos/go-systemd/tags","blobs_url":"https://api.github.com/repos/coreos/go-systemd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coreos/go-systemd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coreos/go-systemd/git/refs{/sha}","trees_url":"https://api.github.com/repos/coreos/go-systemd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coreos/go-systemd/statuses/{sha}","languages_url":"https://api.github.com/repos/coreos/go-systemd/languages","stargazers_url":"https://api.github.com/repos/coreos/go-systemd/stargazers","contributors_url":"https://api.github.com/repos/coreos/go-systemd/contributors","subscribers_url":"https://api.github.com/repos/coreos/go-systemd/subscribers","subscription_url":"https://api.github.com/repos/coreos/go-systemd/subscription","commits_url":"https://api.github.com/repos/coreos/go-systemd/commits{/sha}","git_commits_url":"https://api.github.com/repos/coreos/go-systemd/git/commits{/sha}","comments_url":"https://api.github.com/repos/coreos/go-systemd/comments{/number}","issue_comment_url":"https://api.github.com/repos/coreos/go-systemd/issues/comments{/number}","contents_url":"https://api.github.com/repos/coreos/go-systemd/contents/{+path}","compare_url":"https://api.github.com/repos/coreos/go-systemd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coreos/go-systemd/merges","archive_url":"https://api.github.com/repos/coreos/go-systemd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coreos/go-systemd/downloads","issues_url":"https://api.github.com/repos/coreos/go-systemd/issues{/number}","pulls_url":"https://api.github.com/repos/coreos/go-systemd/pulls{/number}","milestones_url":"https://api.github.com/repos/coreos/go-systemd/milestones{/number}","notifications_url":"https://api.github.com/repos/coreos/go-systemd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coreos/go-systemd/labels{/name}","releases_url":"https://api.github.com/repos/coreos/go-systemd/releases{/id}","created_at":"2013-09-13T23:13:51Z","updated_at":"2015-12-16T19:27:24Z","pushed_at":"2015-12-19T06:58:07Z","git_url":"git://github.com/coreos/go-systemd.git","ssh_url":"git@github.com:coreos/go-systemd.git","clone_url":"https://github.com/coreos/go-systemd.git","svn_url":"https://github.com/coreos/go-systemd","homepage":"","size":359,"stargazers_count":225,"watchers_count":225,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":74,"mirror_url":null,"open_issues_count":14,"forks":74,"open_issues":14,"watchers":225,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coreos/go-systemd/pulls/128"},"html":{"href":"https://github.com/coreos/go-systemd/pull/128"},"issue":{"href":"https://api.github.com/repos/coreos/go-systemd/issues/128"},"comments":{"href":"https://api.github.com/repos/coreos/go-systemd/issues/128/comments"},"review_comments":{"href":"https://api.github.com/repos/coreos/go-systemd/pulls/128/comments"},"review_comment":{"href":"https://api.github.com/repos/coreos/go-systemd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coreos/go-systemd/pulls/128/commits"},"statuses":{"href":"https://api.github.com/repos/coreos/go-systemd/statuses/e9e7fcbb50d8ee180e220c8585ff612e1880ddc7"}}}}