{"action":"created","comment":{"url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/comments/220763348","pull_request_review_id":159246608,"id":220763348,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDc2MzM0OA==","diff_hunk":"@@ -0,0 +1,39 @@\n+// Submitted by Christopher Milan (christopherm99)\n+\n+package main\n+\n+import (\n+\t\"fmt\"\n+\t\"math/rand\"\n+\t\"time\"\n+)\n+\n+func shuffle(a []int) []int {\n+\trand.Seed(time.Now().UnixNano())\n+\tfor i := len(a) - 1; i > 0; i-- {\n+\t\tj := rand.Intn(i + 1)\n+\t\ta[i], a[j] = a[j], a[i]\n+\t}\n+\treturn a\n+}\n+\n+func is_sorted(a []int) bool {\n+\tfor i := 0; i < len(a)-1; i++ {\n+\t\tif a[i+1] < a[i] {\n+\t\t\treturn false\n+\t\t}\n+\t}\n+\treturn true\n+}\n+\n+func bogo_sort(a *[]int) {\n+\tfor !is_sorted(*a) {\n+\t\t*a = shuffle(*a)","path":"contents/bogo_sort/code/go/main.go","position":31,"original_position":31,"commit_id":"eac737c7382cd31e6b2fb1b67dd8cc2ff3191b4e","original_commit_id":"eac737c7382cd31e6b2fb1b67dd8cc2ff3191b4e","user":{"login":"Liikt","id":10891400,"node_id":"MDQ6VXNlcjEwODkxNDAw","avatar_url":"https://avatars1.githubusercontent.com/u/10891400?v=4","gravatar_id":"","url":"https://api.github.com/users/Liikt","html_url":"https://github.com/Liikt","followers_url":"https://api.github.com/users/Liikt/followers","following_url":"https://api.github.com/users/Liikt/following{/other_user}","gists_url":"https://api.github.com/users/Liikt/gists{/gist_id}","starred_url":"https://api.github.com/users/Liikt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Liikt/subscriptions","organizations_url":"https://api.github.com/users/Liikt/orgs","repos_url":"https://api.github.com/users/Liikt/repos","events_url":"https://api.github.com/users/Liikt/events{/privacy}","received_events_url":"https://api.github.com/users/Liikt/received_events","type":"User","site_admin":false},"body":"If you already work with pointers why not make the shuffe inplace. So basically change `*a = shuffle(*a)` to `shuffle(a)`. \r\nI would say either remove all pointers and let every function return it's value or change line 15 to ` (*a)[i], (*a)[j] = (*a)[j], (*a)[i]` and take in a `*[]int` as a parameter in shuffle.","created_at":"2018-09-27T00:30:22Z","updated_at":"2018-09-27T00:33:19Z","html_url":"https://github.com/algorithm-archivists/algorithm-archive/pull/365#discussion_r220763348","pull_request_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/365","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/comments/220763348"},"html":{"href":"https://github.com/algorithm-archivists/algorithm-archive/pull/365#discussion_r220763348"},"pull_request":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/365"}}},"pull_request":{"url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/365","id":213088490,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzMDg4NDkw","html_url":"https://github.com/algorithm-archivists/algorithm-archive/pull/365","diff_url":"https://github.com/algorithm-archivists/algorithm-archive/pull/365.diff","patch_url":"https://github.com/algorithm-archivists/algorithm-archive/pull/365.patch","issue_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues/365","number":365,"state":"open","locked":false,"title":"Add bogo sort in Golang","user":{"login":"christopherm99","id":29442581,"node_id":"MDQ6VXNlcjI5NDQyNTgx","avatar_url":"https://avatars3.githubusercontent.com/u/29442581?v=4","gravatar_id":"","url":"https://api.github.com/users/christopherm99","html_url":"https://github.com/christopherm99","followers_url":"https://api.github.com/users/christopherm99/followers","following_url":"https://api.github.com/users/christopherm99/following{/other_user}","gists_url":"https://api.github.com/users/christopherm99/gists{/gist_id}","starred_url":"https://api.github.com/users/christopherm99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopherm99/subscriptions","organizations_url":"https://api.github.com/users/christopherm99/orgs","repos_url":"https://api.github.com/users/christopherm99/repos","events_url":"https://api.github.com/users/christopherm99/events{/privacy}","received_events_url":"https://api.github.com/users/christopherm99/received_events","type":"User","site_admin":false},"body":"This was compiled the `go1.10.3` compiler on linux, and raises no errors.\r\n","created_at":"2018-09-04T20:05:25Z","updated_at":"2018-09-27T00:33:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1b8b3fd90f19e96ccc9bddc9932d9b55fbaa22e5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":917133710,"node_id":"MDU6TGFiZWw5MTcxMzM3MTA=","url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/labels/Implementation","name":"Implementation","color":"0960e2","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/365/commits","review_comments_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/365/comments","review_comment_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/comments{/number}","comments_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues/365/comments","statuses_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/statuses/eac737c7382cd31e6b2fb1b67dd8cc2ff3191b4e","head":{"label":"christopherm99:master","ref":"master","sha":"eac737c7382cd31e6b2fb1b67dd8cc2ff3191b4e","user":{"login":"christopherm99","id":29442581,"node_id":"MDQ6VXNlcjI5NDQyNTgx","avatar_url":"https://avatars3.githubusercontent.com/u/29442581?v=4","gravatar_id":"","url":"https://api.github.com/users/christopherm99","html_url":"https://github.com/christopherm99","followers_url":"https://api.github.com/users/christopherm99/followers","following_url":"https://api.github.com/users/christopherm99/following{/other_user}","gists_url":"https://api.github.com/users/christopherm99/gists{/gist_id}","starred_url":"https://api.github.com/users/christopherm99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopherm99/subscriptions","organizations_url":"https://api.github.com/users/christopherm99/orgs","repos_url":"https://api.github.com/users/christopherm99/repos","events_url":"https://api.github.com/users/christopherm99/events{/privacy}","received_events_url":"https://api.github.com/users/christopherm99/received_events","type":"User","site_admin":false},"repo":{"id":147405247,"node_id":"MDEwOlJlcG9zaXRvcnkxNDc0MDUyNDc=","name":"algorithm-archive","full_name":"christopherm99/algorithm-archive","private":false,"owner":{"login":"christopherm99","id":29442581,"node_id":"MDQ6VXNlcjI5NDQyNTgx","avatar_url":"https://avatars3.githubusercontent.com/u/29442581?v=4","gravatar_id":"","url":"https://api.github.com/users/christopherm99","html_url":"https://github.com/christopherm99","followers_url":"https://api.github.com/users/christopherm99/followers","following_url":"https://api.github.com/users/christopherm99/following{/other_user}","gists_url":"https://api.github.com/users/christopherm99/gists{/gist_id}","starred_url":"https://api.github.com/users/christopherm99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopherm99/subscriptions","organizations_url":"https://api.github.com/users/christopherm99/orgs","repos_url":"https://api.github.com/users/christopherm99/repos","events_url":"https://api.github.com/users/christopherm99/events{/privacy}","received_events_url":"https://api.github.com/users/christopherm99/received_events","type":"User","site_admin":false},"html_url":"https://github.com/christopherm99/algorithm-archive","description":"A collaborative book on algorithms","fork":true,"url":"https://api.github.com/repos/christopherm99/algorithm-archive","forks_url":"https://api.github.com/repos/christopherm99/algorithm-archive/forks","keys_url":"https://api.github.com/repos/christopherm99/algorithm-archive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/christopherm99/algorithm-archive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/christopherm99/algorithm-archive/teams","hooks_url":"https://api.github.com/repos/christopherm99/algorithm-archive/hooks","issue_events_url":"https://api.github.com/repos/christopherm99/algorithm-archive/issues/events{/number}","events_url":"https://api.github.com/repos/christopherm99/algorithm-archive/events","assignees_url":"https://api.github.com/repos/christopherm99/algorithm-archive/assignees{/user}","branches_url":"https://api.github.com/repos/christopherm99/algorithm-archive/branches{/branch}","tags_url":"https://api.github.com/repos/christopherm99/algorithm-archive/tags","blobs_url":"https://api.github.com/repos/christopherm99/algorithm-archive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/christopherm99/algorithm-archive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/christopherm99/algorithm-archive/git/refs{/sha}","trees_url":"https://api.github.com/repos/christopherm99/algorithm-archive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/christopherm99/algorithm-archive/statuses/{sha}","languages_url":"https://api.github.com/repos/christopherm99/algorithm-archive/languages","stargazers_url":"https://api.github.com/repos/christopherm99/algorithm-archive/stargazers","contributors_url":"https://api.github.com/repos/christopherm99/algorithm-archive/contributors","subscribers_url":"https://api.github.com/repos/christopherm99/algorithm-archive/subscribers","subscription_url":"https://api.github.com/repos/christopherm99/algorithm-archive/subscription","commits_url":"https://api.github.com/repos/christopherm99/algorithm-archive/commits{/sha}","git_commits_url":"https://api.github.com/repos/christopherm99/algorithm-archive/git/commits{/sha}","comments_url":"https://api.github.com/repos/christopherm99/algorithm-archive/comments{/number}","issue_comment_url":"https://api.github.com/repos/christopherm99/algorithm-archive/issues/comments{/number}","contents_url":"https://api.github.com/repos/christopherm99/algorithm-archive/contents/{+path}","compare_url":"https://api.github.com/repos/christopherm99/algorithm-archive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/christopherm99/algorithm-archive/merges","archive_url":"https://api.github.com/repos/christopherm99/algorithm-archive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/christopherm99/algorithm-archive/downloads","issues_url":"https://api.github.com/repos/christopherm99/algorithm-archive/issues{/number}","pulls_url":"https://api.github.com/repos/christopherm99/algorithm-archive/pulls{/number}","milestones_url":"https://api.github.com/repos/christopherm99/algorithm-archive/milestones{/number}","notifications_url":"https://api.github.com/repos/christopherm99/algorithm-archive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/christopherm99/algorithm-archive/labels{/name}","releases_url":"https://api.github.com/repos/christopherm99/algorithm-archive/releases{/id}","deployments_url":"https://api.github.com/repos/christopherm99/algorithm-archive/deployments","created_at":"2018-09-04T19:47:32Z","updated_at":"2018-09-04T19:54:31Z","pushed_at":"2018-09-04T19:54:29Z","git_url":"git://github.com/christopherm99/algorithm-archive.git","ssh_url":"git@github.com:christopherm99/algorithm-archive.git","clone_url":"https://github.com/christopherm99/algorithm-archive.git","svn_url":"https://github.com/christopherm99/algorithm-archive","homepage":"https://www.algorithm-archive.org","size":8651,"stargazers_count":0,"watchers_count":0,"language":"C","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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"algorithm-archivists:master","ref":"master","sha":"a1a6dfa05b7828badf5e32e077f48c8809b9da16","user":{"login":"algorithm-archivists","id":38796691,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4Nzk2Njkx","avatar_url":"https://avatars2.githubusercontent.com/u/38796691?v=4","gravatar_id":"","url":"https://api.github.com/users/algorithm-archivists","html_url":"https://github.com/algorithm-archivists","followers_url":"https://api.github.com/users/algorithm-archivists/followers","following_url":"https://api.github.com/users/algorithm-archivists/following{/other_user}","gists_url":"https://api.github.com/users/algorithm-archivists/gists{/gist_id}","starred_url":"https://api.github.com/users/algorithm-archivists/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/algorithm-archivists/subscriptions","organizations_url":"https://api.github.com/users/algorithm-archivists/orgs","repos_url":"https://api.github.com/users/algorithm-archivists/repos","events_url":"https://api.github.com/users/algorithm-archivists/events{/privacy}","received_events_url":"https://api.github.com/users/algorithm-archivists/received_events","type":"Organization","site_admin":false},"repo":{"id":81649789,"node_id":"MDEwOlJlcG9zaXRvcnk4MTY0OTc4OQ==","name":"algorithm-archive","full_name":"algorithm-archivists/algorithm-archive","private":false,"owner":{"login":"algorithm-archivists","id":38796691,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM4Nzk2Njkx","avatar_url":"https://avatars2.githubusercontent.com/u/38796691?v=4","gravatar_id":"","url":"https://api.github.com/users/algorithm-archivists","html_url":"https://github.com/algorithm-archivists","followers_url":"https://api.github.com/users/algorithm-archivists/followers","following_url":"https://api.github.com/users/algorithm-archivists/following{/other_user}","gists_url":"https://api.github.com/users/algorithm-archivists/gists{/gist_id}","starred_url":"https://api.github.com/users/algorithm-archivists/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/algorithm-archivists/subscriptions","organizations_url":"https://api.github.com/users/algorithm-archivists/orgs","repos_url":"https://api.github.com/users/algorithm-archivists/repos","events_url":"https://api.github.com/users/algorithm-archivists/events{/privacy}","received_events_url":"https://api.github.com/users/algorithm-archivists/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/algorithm-archivists/algorithm-archive","description":"A collaborative book on algorithms","fork":false,"url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive","forks_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/forks","keys_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/keys{/key_id}","collaborators_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/teams","hooks_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/hooks","issue_events_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues/events{/number}","events_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/events","assignees_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/assignees{/user}","branches_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/branches{/branch}","tags_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/tags","blobs_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/git/refs{/sha}","trees_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/git/trees{/sha}","statuses_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/statuses/{sha}","languages_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/languages","stargazers_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/stargazers","contributors_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/contributors","subscribers_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/subscribers","subscription_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/subscription","commits_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/commits{/sha}","git_commits_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/git/commits{/sha}","comments_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/comments{/number}","issue_comment_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues/comments{/number}","contents_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/contents/{+path}","compare_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/compare/{base}...{head}","merges_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/merges","archive_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/downloads","issues_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues{/number}","pulls_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls{/number}","milestones_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/milestones{/number}","notifications_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/labels{/name}","releases_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/releases{/id}","deployments_url":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/deployments","created_at":"2017-02-11T11:52:40Z","updated_at":"2018-09-26T23:40:54Z","pushed_at":"2018-09-26T01:02:39Z","git_url":"git://github.com/algorithm-archivists/algorithm-archive.git","ssh_url":"git@github.com:algorithm-archivists/algorithm-archive.git","clone_url":"https://github.com/algorithm-archivists/algorithm-archive.git","svn_url":"https://github.com/algorithm-archivists/algorithm-archive","homepage":"https://www.algorithm-archive.org","size":8698,"stargazers_count":569,"watchers_count":569,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":138,"mirror_url":null,"archived":false,"open_issues_count":32,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":138,"open_issues":32,"watchers":569,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/365"},"html":{"href":"https://github.com/algorithm-archivists/algorithm-archive/pull/365"},"issue":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues/365"},"comments":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/issues/365/comments"},"review_comments":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/365/comments"},"review_comment":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/pulls/365/commits"},"statuses":{"href":"https://api.github.com/repos/algorithm-archivists/algorithm-archive/statuses/eac737c7382cd31e6b2fb1b67dd8cc2ff3191b4e"}},"author_association":"NONE"}}
{"actor":{"display_login":"Liikt"}}