{"action":"created","comment":{"url":"https://api.github.com/repos/google/fleetspeak/pulls/comments/176832418","pull_request_review_id":106610363,"id":176832418,"diff_hunk":"@@ -60,6 +62,29 @@ func (d *Datastore) Close() error {\n \treturn d.db.Close()\n }\n \n+// toClientID converts a uint64 into a ClientID.\n+func toClientID(id uint64) common.ClientID {\n+\tif id == 0 {\n+\t\treturn common.ClientID{}\n+\t}\n+\td := [8]byte{}\n+\tbinary.LittleEndian.PutUint64(d[:], id)\n+\tr, err := common.BytesToClientID(d[:])\n+\tif err != nil {\n+\t\t// Should never happen, since d is hardcoded to the right length.\n+\t\tlog.Fatalf(\"Unable to parse client id [%x]: %v\", err)\n+\t}\n+\treturn r\n+}\n+\n+// fromClientID converts a ClientID into a uint64.\n+func fromClientID(id common.ClientID) uint64 {","path":"fleetspeak/src/server/mysql/mysql.go","position":33,"original_position":33,"commit_id":"810fc07a2b82f71d5d7e50e581f61199d1a76406","original_commit_id":"810fc07a2b82f71d5d7e50e581f61199d1a76406","user":{"login":"mrhania","id":1961136,"avatar_url":"https://avatars3.githubusercontent.com/u/1961136?v=4","gravatar_id":"","url":"https://api.github.com/users/mrhania","html_url":"https://github.com/mrhania","followers_url":"https://api.github.com/users/mrhania/followers","following_url":"https://api.github.com/users/mrhania/following{/other_user}","gists_url":"https://api.github.com/users/mrhania/gists{/gist_id}","starred_url":"https://api.github.com/users/mrhania/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrhania/subscriptions","organizations_url":"https://api.github.com/users/mrhania/orgs","repos_url":"https://api.github.com/users/mrhania/repos","events_url":"https://api.github.com/users/mrhania/events{/privacy}","received_events_url":"https://api.github.com/users/mrhania/received_events","type":"User","site_admin":false},"body":"I am not sure abut the name of this function. If you read its usage (`fromClientId(client_id)`) it is no immediately known what is going: from client id into what? You have to lookup the definition to figure this out. And you even need an extra comment to fully describe what this function does. I think that something more descriptive like `FromClientIDToUint64` or `Uint64FromClientID`, while being lengthier, is much better to understand and read.\r\n\r\nI am not sure how it goes with \"Go spirit\" though. I know that Go tends to be rather concise and this feels more javastic (or even objective-cish where you cram entire sentences into identifiers). So treat it just as a suggestion.\r\n\r\n`toClientID` is fine and descriptive enough on its own. However, if you decide to rename `fromClientID` then for consistency reasons you should adjust `toClientID` accordingly.","created_at":"2018-03-23T18:46:40Z","updated_at":"2018-03-23T18:48:44Z","html_url":"https://github.com/google/fleetspeak/pull/84#discussion_r176832418","pull_request_url":"https://api.github.com/repos/google/fleetspeak/pulls/84","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/google/fleetspeak/pulls/comments/176832418"},"html":{"href":"https://github.com/google/fleetspeak/pull/84#discussion_r176832418"},"pull_request":{"href":"https://api.github.com/repos/google/fleetspeak/pulls/84"}}},"pull_request":{"url":"https://api.github.com/repos/google/fleetspeak/pulls/84","id":176863557,"html_url":"https://github.com/google/fleetspeak/pull/84","diff_url":"https://github.com/google/fleetspeak/pull/84.diff","patch_url":"https://github.com/google/fleetspeak/pull/84.patch","issue_url":"https://api.github.com/repos/google/fleetspeak/issues/84","number":84,"state":"open","locked":false,"title":"Store client_ids as uint64s in the mysql datastore.","user":{"login":"bgalehouse","id":9697041,"avatar_url":"https://avatars1.githubusercontent.com/u/9697041?v=4","gravatar_id":"","url":"https://api.github.com/users/bgalehouse","html_url":"https://github.com/bgalehouse","followers_url":"https://api.github.com/users/bgalehouse/followers","following_url":"https://api.github.com/users/bgalehouse/following{/other_user}","gists_url":"https://api.github.com/users/bgalehouse/gists{/gist_id}","starred_url":"https://api.github.com/users/bgalehouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgalehouse/subscriptions","organizations_url":"https://api.github.com/users/bgalehouse/orgs","repos_url":"https://api.github.com/users/bgalehouse/repos","events_url":"https://api.github.com/users/bgalehouse/events{/privacy}","received_events_url":"https://api.github.com/users/bgalehouse/received_events","type":"User","site_admin":false},"body":"Issue #81 ","created_at":"2018-03-22T18:03:09Z","updated_at":"2018-03-23T18:48:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dca9623eba302ddbff7351191776f95b58bd6e84","assignee":null,"assignees":[],"requested_reviewers":[{"login":"demonchild2112","id":3885393,"avatar_url":"https://avatars3.githubusercontent.com/u/3885393?v=4","gravatar_id":"","url":"https://api.github.com/users/demonchild2112","html_url":"https://github.com/demonchild2112","followers_url":"https://api.github.com/users/demonchild2112/followers","following_url":"https://api.github.com/users/demonchild2112/following{/other_user}","gists_url":"https://api.github.com/users/demonchild2112/gists{/gist_id}","starred_url":"https://api.github.com/users/demonchild2112/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demonchild2112/subscriptions","organizations_url":"https://api.github.com/users/demonchild2112/orgs","repos_url":"https://api.github.com/users/demonchild2112/repos","events_url":"https://api.github.com/users/demonchild2112/events{/privacy}","received_events_url":"https://api.github.com/users/demonchild2112/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/fleetspeak/pulls/84/commits","review_comments_url":"https://api.github.com/repos/google/fleetspeak/pulls/84/comments","review_comment_url":"https://api.github.com/repos/google/fleetspeak/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/fleetspeak/issues/84/comments","statuses_url":"https://api.github.com/repos/google/fleetspeak/statuses/810fc07a2b82f71d5d7e50e581f61199d1a76406","head":{"label":"bgalehouse:mysql","ref":"mysql","sha":"810fc07a2b82f71d5d7e50e581f61199d1a76406","user":{"login":"bgalehouse","id":9697041,"avatar_url":"https://avatars1.githubusercontent.com/u/9697041?v=4","gravatar_id":"","url":"https://api.github.com/users/bgalehouse","html_url":"https://github.com/bgalehouse","followers_url":"https://api.github.com/users/bgalehouse/followers","following_url":"https://api.github.com/users/bgalehouse/following{/other_user}","gists_url":"https://api.github.com/users/bgalehouse/gists{/gist_id}","starred_url":"https://api.github.com/users/bgalehouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgalehouse/subscriptions","organizations_url":"https://api.github.com/users/bgalehouse/orgs","repos_url":"https://api.github.com/users/bgalehouse/repos","events_url":"https://api.github.com/users/bgalehouse/events{/privacy}","received_events_url":"https://api.github.com/users/bgalehouse/received_events","type":"User","site_admin":false},"repo":{"id":112669315,"name":"fleetspeak","full_name":"bgalehouse/fleetspeak","owner":{"login":"bgalehouse","id":9697041,"avatar_url":"https://avatars1.githubusercontent.com/u/9697041?v=4","gravatar_id":"","url":"https://api.github.com/users/bgalehouse","html_url":"https://github.com/bgalehouse","followers_url":"https://api.github.com/users/bgalehouse/followers","following_url":"https://api.github.com/users/bgalehouse/following{/other_user}","gists_url":"https://api.github.com/users/bgalehouse/gists{/gist_id}","starred_url":"https://api.github.com/users/bgalehouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgalehouse/subscriptions","organizations_url":"https://api.github.com/users/bgalehouse/orgs","repos_url":"https://api.github.com/users/bgalehouse/repos","events_url":"https://api.github.com/users/bgalehouse/events{/privacy}","received_events_url":"https://api.github.com/users/bgalehouse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bgalehouse/fleetspeak","description":null,"fork":true,"url":"https://api.github.com/repos/bgalehouse/fleetspeak","forks_url":"https://api.github.com/repos/bgalehouse/fleetspeak/forks","keys_url":"https://api.github.com/repos/bgalehouse/fleetspeak/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bgalehouse/fleetspeak/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bgalehouse/fleetspeak/teams","hooks_url":"https://api.github.com/repos/bgalehouse/fleetspeak/hooks","issue_events_url":"https://api.github.com/repos/bgalehouse/fleetspeak/issues/events{/number}","events_url":"https://api.github.com/repos/bgalehouse/fleetspeak/events","assignees_url":"https://api.github.com/repos/bgalehouse/fleetspeak/assignees{/user}","branches_url":"https://api.github.com/repos/bgalehouse/fleetspeak/branches{/branch}","tags_url":"https://api.github.com/repos/bgalehouse/fleetspeak/tags","blobs_url":"https://api.github.com/repos/bgalehouse/fleetspeak/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bgalehouse/fleetspeak/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bgalehouse/fleetspeak/git/refs{/sha}","trees_url":"https://api.github.com/repos/bgalehouse/fleetspeak/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bgalehouse/fleetspeak/statuses/{sha}","languages_url":"https://api.github.com/repos/bgalehouse/fleetspeak/languages","stargazers_url":"https://api.github.com/repos/bgalehouse/fleetspeak/stargazers","contributors_url":"https://api.github.com/repos/bgalehouse/fleetspeak/contributors","subscribers_url":"https://api.github.com/repos/bgalehouse/fleetspeak/subscribers","subscription_url":"https://api.github.com/repos/bgalehouse/fleetspeak/subscription","commits_url":"https://api.github.com/repos/bgalehouse/fleetspeak/commits{/sha}","git_commits_url":"https://api.github.com/repos/bgalehouse/fleetspeak/git/commits{/sha}","comments_url":"https://api.github.com/repos/bgalehouse/fleetspeak/comments{/number}","issue_comment_url":"https://api.github.com/repos/bgalehouse/fleetspeak/issues/comments{/number}","contents_url":"https://api.github.com/repos/bgalehouse/fleetspeak/contents/{+path}","compare_url":"https://api.github.com/repos/bgalehouse/fleetspeak/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bgalehouse/fleetspeak/merges","archive_url":"https://api.github.com/repos/bgalehouse/fleetspeak/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bgalehouse/fleetspeak/downloads","issues_url":"https://api.github.com/repos/bgalehouse/fleetspeak/issues{/number}","pulls_url":"https://api.github.com/repos/bgalehouse/fleetspeak/pulls{/number}","milestones_url":"https://api.github.com/repos/bgalehouse/fleetspeak/milestones{/number}","notifications_url":"https://api.github.com/repos/bgalehouse/fleetspeak/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bgalehouse/fleetspeak/labels{/name}","releases_url":"https://api.github.com/repos/bgalehouse/fleetspeak/releases{/id}","deployments_url":"https://api.github.com/repos/bgalehouse/fleetspeak/deployments","created_at":"2017-11-30T22:47:28Z","updated_at":"2018-03-22T14:16:59Z","pushed_at":"2018-03-22T19:19:33Z","git_url":"git://github.com/bgalehouse/fleetspeak.git","ssh_url":"git@github.com:bgalehouse/fleetspeak.git","clone_url":"https://github.com/bgalehouse/fleetspeak.git","svn_url":"https://github.com/bgalehouse/fleetspeak","homepage":null,"size":20557,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"c11dd0f1ed68c11b42cc502f73229463698b2284","user":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":111568113,"name":"fleetspeak","full_name":"google/fleetspeak","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/fleetspeak","description":null,"fork":false,"url":"https://api.github.com/repos/google/fleetspeak","forks_url":"https://api.github.com/repos/google/fleetspeak/forks","keys_url":"https://api.github.com/repos/google/fleetspeak/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/fleetspeak/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/fleetspeak/teams","hooks_url":"https://api.github.com/repos/google/fleetspeak/hooks","issue_events_url":"https://api.github.com/repos/google/fleetspeak/issues/events{/number}","events_url":"https://api.github.com/repos/google/fleetspeak/events","assignees_url":"https://api.github.com/repos/google/fleetspeak/assignees{/user}","branches_url":"https://api.github.com/repos/google/fleetspeak/branches{/branch}","tags_url":"https://api.github.com/repos/google/fleetspeak/tags","blobs_url":"https://api.github.com/repos/google/fleetspeak/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/fleetspeak/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/fleetspeak/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/fleetspeak/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/fleetspeak/statuses/{sha}","languages_url":"https://api.github.com/repos/google/fleetspeak/languages","stargazers_url":"https://api.github.com/repos/google/fleetspeak/stargazers","contributors_url":"https://api.github.com/repos/google/fleetspeak/contributors","subscribers_url":"https://api.github.com/repos/google/fleetspeak/subscribers","subscription_url":"https://api.github.com/repos/google/fleetspeak/subscription","commits_url":"https://api.github.com/repos/google/fleetspeak/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/fleetspeak/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/fleetspeak/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/fleetspeak/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/fleetspeak/contents/{+path}","compare_url":"https://api.github.com/repos/google/fleetspeak/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/fleetspeak/merges","archive_url":"https://api.github.com/repos/google/fleetspeak/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/fleetspeak/downloads","issues_url":"https://api.github.com/repos/google/fleetspeak/issues{/number}","pulls_url":"https://api.github.com/repos/google/fleetspeak/pulls{/number}","milestones_url":"https://api.github.com/repos/google/fleetspeak/milestones{/number}","notifications_url":"https://api.github.com/repos/google/fleetspeak/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/fleetspeak/labels{/name}","releases_url":"https://api.github.com/repos/google/fleetspeak/releases{/id}","deployments_url":"https://api.github.com/repos/google/fleetspeak/deployments","created_at":"2017-11-21T15:38:49Z","updated_at":"2018-03-22T16:58:11Z","pushed_at":"2018-03-22T19:19:34Z","git_url":"git://github.com/google/fleetspeak.git","ssh_url":"git@github.com:google/fleetspeak.git","clone_url":"https://github.com/google/fleetspeak.git","svn_url":"https://github.com/google/fleetspeak","homepage":null,"size":20546,"stargazers_count":46,"watchers_count":46,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":9,"open_issues":7,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/fleetspeak/pulls/84"},"html":{"href":"https://github.com/google/fleetspeak/pull/84"},"issue":{"href":"https://api.github.com/repos/google/fleetspeak/issues/84"},"comments":{"href":"https://api.github.com/repos/google/fleetspeak/issues/84/comments"},"review_comments":{"href":"https://api.github.com/repos/google/fleetspeak/pulls/84/comments"},"review_comment":{"href":"https://api.github.com/repos/google/fleetspeak/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/fleetspeak/pulls/84/commits"},"statuses":{"href":"https://api.github.com/repos/google/fleetspeak/statuses/810fc07a2b82f71d5d7e50e581f61199d1a76406"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"mrhania"}}