diff --git a/got.json b/got.json new file mode 100644 index 0000000..2637165 --- /dev/null +++ b/got.json @@ -0,0 +1,111 @@ +{ + "total_count": 1, + "incomplete_results": false, + "items": [ + { + "id": 430975512, + "node_id": "R_kgDOGbAqGA", + "name": "pacing.app", + "full_name": "marwanhawari/pacing.app", + "private": false, + "owner": { + "login": "marwanhawari", + "id": 59078997, + "node_id": "MDQ6VXNlcjU5MDc4OTk3", + "avatar_url": "https://avatars.githubusercontent.com/u/59078997?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/marwanhawari", + "html_url": "https://github.com/marwanhawari", + "followers_url": "https://api.github.com/users/marwanhawari/followers", + "following_url": "https://api.github.com/users/marwanhawari/following{/other_user}", + "gists_url": "https://api.github.com/users/marwanhawari/gists{/gist_id}", + "starred_url": "https://api.github.com/users/marwanhawari/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/marwanhawari/subscriptions", + "organizations_url": "https://api.github.com/users/marwanhawari/orgs", + "repos_url": "https://api.github.com/users/marwanhawari/repos", + "events_url": "https://api.github.com/users/marwanhawari/events{/privacy}", + "received_events_url": "https://api.github.com/users/marwanhawari/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/marwanhawari/pacing.app", + "description": "⏱ A simple and intuitive website for calculating your running pace.", + "fork": false, + "url": "https://api.github.com/repos/marwanhawari/pacing.app", + "forks_url": "https://api.github.com/repos/marwanhawari/pacing.app/forks", + "keys_url": "https://api.github.com/repos/marwanhawari/pacing.app/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/marwanhawari/pacing.app/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/marwanhawari/pacing.app/teams", + "hooks_url": "https://api.github.com/repos/marwanhawari/pacing.app/hooks", + "issue_events_url": "https://api.github.com/repos/marwanhawari/pacing.app/issues/events{/number}", + "events_url": "https://api.github.com/repos/marwanhawari/pacing.app/events", + "assignees_url": "https://api.github.com/repos/marwanhawari/pacing.app/assignees{/user}", + "branches_url": "https://api.github.com/repos/marwanhawari/pacing.app/branches{/branch}", + "tags_url": "https://api.github.com/repos/marwanhawari/pacing.app/tags", + "blobs_url": "https://api.github.com/repos/marwanhawari/pacing.app/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/marwanhawari/pacing.app/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/marwanhawari/pacing.app/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/marwanhawari/pacing.app/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/marwanhawari/pacing.app/statuses/{sha}", + "languages_url": "https://api.github.com/repos/marwanhawari/pacing.app/languages", + "stargazers_url": "https://api.github.com/repos/marwanhawari/pacing.app/stargazers", + "contributors_url": "https://api.github.com/repos/marwanhawari/pacing.app/contributors", + "subscribers_url": "https://api.github.com/repos/marwanhawari/pacing.app/subscribers", + "subscription_url": "https://api.github.com/repos/marwanhawari/pacing.app/subscription", + "commits_url": "https://api.github.com/repos/marwanhawari/pacing.app/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/marwanhawari/pacing.app/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/marwanhawari/pacing.app/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/marwanhawari/pacing.app/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/marwanhawari/pacing.app/contents/{+path}", + "compare_url": "https://api.github.com/repos/marwanhawari/pacing.app/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/marwanhawari/pacing.app/merges", + "archive_url": "https://api.github.com/repos/marwanhawari/pacing.app/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/marwanhawari/pacing.app/downloads", + "issues_url": "https://api.github.com/repos/marwanhawari/pacing.app/issues{/number}", + "pulls_url": "https://api.github.com/repos/marwanhawari/pacing.app/pulls{/number}", + "milestones_url": "https://api.github.com/repos/marwanhawari/pacing.app/milestones{/number}", + "notifications_url": "https://api.github.com/repos/marwanhawari/pacing.app/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/marwanhawari/pacing.app/labels{/name}", + "releases_url": "https://api.github.com/repos/marwanhawari/pacing.app/releases{/id}", + "deployments_url": "https://api.github.com/repos/marwanhawari/pacing.app/deployments", + "created_at": "2021-11-23T05:45:05Z", + "updated_at": "2022-01-08T22:55:06Z", + "pushed_at": "2022-01-08T22:55:04Z", + "git_url": "git://github.com/marwanhawari/pacing.app.git", + "ssh_url": "git@github.com:marwanhawari/pacing.app.git", + "clone_url": "https://github.com/marwanhawari/pacing.app.git", + "svn_url": "https://github.com/marwanhawari/pacing.app", + "homepage": "https://www.pacing.app", + "size": 6494, + "stargazers_count": 0, + "watchers_count": 0, + "language": "JavaScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "topics": ["pace", "running", "webapp", "website"], + "visibility": "public", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "score": 1.0 + } + ] +} diff --git a/lib/github_test.go b/lib/github_test.go index 3851ddb..fe9514d 100644 --- a/lib/github_test.go +++ b/lib/github_test.go @@ -535,12 +535,7 @@ func Test_darwinARMFallback(t *testing.T) { } } -var testGithubSearchJSON = `{"total_count":1,"incomplete_results":false,` + - `"items":[{"id":430975512,"node_id":"R_kgDOGbAqGA","name":"pacing.app","full_name":"marwanhawari/pacing.app","private":false,"owner":{"login":"marwanhawari","id":59078997,"node_id":"MDQ6VXNlcjU5MDc4OTk3","avatar_url":"https://avatars.githubusercontent.com/u/59078997?v=4","gravatar_id":"","url":"https://api.github.com/users/marwanhawari","html_url":"https://github.com/marwanhawari","followers_url":"https://api.github.com/users/marwanhawari/followers","following_url":"https://api.github.com/users/marwanhawari/following{/other_user}","gists_url":"https://api.github.com/users/marwanhawari/gists{/gist_id}","starred_url":"https://api.github.com/users/marwanhawari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marwanhawari/subscriptions","organizations_url":"https://api.github.com/users/marwanhawari/orgs","repos_url":"https://api.github.com/users/marwanhawari/repos","events_url":"https://api.github.com/users/marwanhawari/events{/privacy}","received_events_url":"https://api.github.com/users/marwanhawari/received_events","type":"User","site_admin":false},"html_url":"https://github.com/marwanhawari/pacing.app",` + - `"description":"⏱ A simple and intuitive website for calculating your running pace.","fork":false,"url":"https://api.github.com/repos/marwanhawari/pacing.app","forks_url":"https://api.github.com/repos/marwanhawari/pacing.app/forks","keys_url":"https://api.github.com/repos/marwanhawari/pacing.app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marwanhawari/pacing.app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marwanhawari/pacing.app/teams","hooks_url":"https://api.github.com/repos/marwanhawari/pacing.app/hooks","issue_events_url":"https://api.github.com/repos/marwanhawari/pacing.app/issues/events{/number}","events_url":"https://api.github.com/repos/marwanhawari/pacing.app/events","assignees_url":"https://api.github.com/repos/marwanhawari/pacing.app/assignees{/user}","branches_url":"https://api.github.com/repos/marwanhawari/pacing.app/branches{/branch}","tags_url":"https://api.github.com/repos/marwanhawari/pacing.app/tags","blobs_url":"https://api.github.com/repos/marwanhawari/pacing.app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marwanhawari/pacing.app/git/tags{/sha}",` + - `"git_refs_url":"https://api.github.com/repos/marwanhawari/pacing.app/git/refs{/sha}","trees_url":"https://api.github.com/repos/marwanhawari/pacing.app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marwanhawari/pacing.app/statuses/{sha}","languages_url":"https://api.github.com/repos/marwanhawari/pacing.app/languages","stargazers_url":"https://api.github.com/repos/marwanhawari/pacing.app/stargazers","contributors_url":"https://api.github.com/repos/marwanhawari/pacing.app/contributors","subscribers_url":"https://api.github.com/repos/marwanhawari/pacing.app/subscribers","subscription_url":"https://api.github.com/repos/marwanhawari/pacing.app/subscription","commits_url":"https://api.github.com/repos/marwanhawari/pacing.app/commits{/sha}","git_commits_url":"https://api.github.com/repos/marwanhawari/pacing.app/git/commits{/sha}","comments_url":"https://api.github.com/repos/marwanhawari/pacing.app/comments{/number}","issue_comment_url":"https://api.github.com/repos/marwanhawari/pacing.app/issues/comments{/number}","contents_url":"https://api.github.com/repos/marwanhawari/pacing.app/contents/{+path}",` + - `"compare_url":"https://api.github.com/repos/marwanhawari/pacing.app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marwanhawari/pacing.app/merges","archive_url":"https://api.github.com/repos/marwanhawari/pacing.app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marwanhawari/pacing.app/downloads","issues_url":"https://api.github.com/repos/marwanhawari/pacing.app/issues{/number}","pulls_url":"https://api.github.com/repos/marwanhawari/pacing.app/pulls{/number}","milestones_url":"https://api.github.com/repos/marwanhawari/pacing.app/milestones{/number}","notifications_url":"https://api.github.com/repos/marwanhawari/pacing.app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marwanhawari/pacing.app/labels{/name}","releases_url":"https://api.github.com/repos/marwanhawari/pacing.app/releases{/id}","deployments_url":"https://api.github.com/repos/marwanhawari/pacing.app/deployments","created_at":"2021-11-23T05:45:05Z","updated_at":"2022-01-08T22:55:06Z","pushed_at":"2022-01-08T22:55:04Z","git_url":"git://github.com/marwanhawari/pacing.app.git",` + - `"ssh_url":"git@github.com:marwanhawari/pacing.app.git","clone_url":"https://github.com/marwanhawari/pacing.app.git","svn_url":"https://github.com/marwanhawari/pacing.app","homepage":"https://www.pacing.app","size":6494,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"allow_forking":true,"is_template":false,"topics":["pace","running","webapp","website"],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"main","permissions":{"admin":true,"maintain":true,"push":true,"triage":true,"pull":true},"score":1.0}]}` +var testGithubSearchJSON, _ = getGithubSearchJSON("marwanhawari/pacing.app") var testGithubSearchReadJSON GithubSearch = GithubSearch{ Count: 1, diff --git a/want.json b/want.json new file mode 100644 index 0000000..f09d70a --- /dev/null +++ b/want.json @@ -0,0 +1,118 @@ +{ + "total_count": 1, + "incomplete_results": false, + "items": [ + { + "id": 430975512, + "node_id": "R_kgDOGbAqGA", + "name": "pacing.app", + "full_name": "marwanhawari/pacing.app", + "private": false, + "owner": { + "login": "marwanhawari", + "id": 59078997, + "node_id": "MDQ6VXNlcjU5MDc4OTk3", + "avatar_url": "https://avatars.githubusercontent.com/u/59078997?v=4", + "gravatar_id": "", + "url": "https://api.github.com/users/marwanhawari", + "html_url": "https://github.com/marwanhawari", + "followers_url": "https://api.github.com/users/marwanhawari/followers", + "following_url": "https://api.github.com/users/marwanhawari/following{/other_user}", + "gists_url": "https://api.github.com/users/marwanhawari/gists{/gist_id}", + "starred_url": "https://api.github.com/users/marwanhawari/starred{/owner}{/repo}", + "subscriptions_url": "https://api.github.com/users/marwanhawari/subscriptions", + "organizations_url": "https://api.github.com/users/marwanhawari/orgs", + "repos_url": "https://api.github.com/users/marwanhawari/repos", + "events_url": "https://api.github.com/users/marwanhawari/events{/privacy}", + "received_events_url": "https://api.github.com/users/marwanhawari/received_events", + "type": "User", + "site_admin": false + }, + "html_url": "https://github.com/marwanhawari/pacing.app", + "description": "⏱ A simple and intuitive website for calculating your running pace.", + "fork": false, + "url": "https://api.github.com/repos/marwanhawari/pacing.app", + "forks_url": "https://api.github.com/repos/marwanhawari/pacing.app/forks", + "keys_url": "https://api.github.com/repos/marwanhawari/pacing.app/keys{/key_id}", + "collaborators_url": "https://api.github.com/repos/marwanhawari/pacing.app/collaborators{/collaborator}", + "teams_url": "https://api.github.com/repos/marwanhawari/pacing.app/teams", + "hooks_url": "https://api.github.com/repos/marwanhawari/pacing.app/hooks", + "issue_events_url": "https://api.github.com/repos/marwanhawari/pacing.app/issues/events{/number}", + "events_url": "https://api.github.com/repos/marwanhawari/pacing.app/events", + "assignees_url": "https://api.github.com/repos/marwanhawari/pacing.app/assignees{/user}", + "branches_url": "https://api.github.com/repos/marwanhawari/pacing.app/branches{/branch}", + "tags_url": "https://api.github.com/repos/marwanhawari/pacing.app/tags", + "blobs_url": "https://api.github.com/repos/marwanhawari/pacing.app/git/blobs{/sha}", + "git_tags_url": "https://api.github.com/repos/marwanhawari/pacing.app/git/tags{/sha}", + "git_refs_url": "https://api.github.com/repos/marwanhawari/pacing.app/git/refs{/sha}", + "trees_url": "https://api.github.com/repos/marwanhawari/pacing.app/git/trees{/sha}", + "statuses_url": "https://api.github.com/repos/marwanhawari/pacing.app/statuses/{sha}", + "languages_url": "https://api.github.com/repos/marwanhawari/pacing.app/languages", + "stargazers_url": "https://api.github.com/repos/marwanhawari/pacing.app/stargazers", + "contributors_url": "https://api.github.com/repos/marwanhawari/pacing.app/contributors", + "subscribers_url": "https://api.github.com/repos/marwanhawari/pacing.app/subscribers", + "subscription_url": "https://api.github.com/repos/marwanhawari/pacing.app/subscription", + "commits_url": "https://api.github.com/repos/marwanhawari/pacing.app/commits{/sha}", + "git_commits_url": "https://api.github.com/repos/marwanhawari/pacing.app/git/commits{/sha}", + "comments_url": "https://api.github.com/repos/marwanhawari/pacing.app/comments{/number}", + "issue_comment_url": "https://api.github.com/repos/marwanhawari/pacing.app/issues/comments{/number}", + "contents_url": "https://api.github.com/repos/marwanhawari/pacing.app/contents/{+path}", + "compare_url": "https://api.github.com/repos/marwanhawari/pacing.app/compare/{base}...{head}", + "merges_url": "https://api.github.com/repos/marwanhawari/pacing.app/merges", + "archive_url": "https://api.github.com/repos/marwanhawari/pacing.app/{archive_format}{/ref}", + "downloads_url": "https://api.github.com/repos/marwanhawari/pacing.app/downloads", + "issues_url": "https://api.github.com/repos/marwanhawari/pacing.app/issues{/number}", + "pulls_url": "https://api.github.com/repos/marwanhawari/pacing.app/pulls{/number}", + "milestones_url": "https://api.github.com/repos/marwanhawari/pacing.app/milestones{/number}", + "notifications_url": "https://api.github.com/repos/marwanhawari/pacing.app/notifications{?since,all,participating}", + "labels_url": "https://api.github.com/repos/marwanhawari/pacing.app/labels{/name}", + "releases_url": "https://api.github.com/repos/marwanhawari/pacing.app/releases{/id}", + "deployments_url": "https://api.github.com/repos/marwanhawari/pacing.app/deployments", + "created_at": "2021-11-23T05:45:05Z", + "updated_at": "2022-01-08T22:55:06Z", + "pushed_at": "2022-01-08T22:55:04Z", + "git_url": "git://github.com/marwanhawari/pacing.app.git", + "ssh_url": "git@github.com:marwanhawari/pacing.app.git", + "clone_url": "https://github.com/marwanhawari/pacing.app.git", + "svn_url": "https://github.com/marwanhawari/pacing.app", + "homepage": "https://www.pacing.app", + "size": 6494, + "stargazers_count": 0, + "watchers_count": 0, + "language": "JavaScript", + "has_issues": true, + "has_projects": true, + "has_downloads": true, + "has_wiki": true, + "has_pages": true, + "forks_count": 0, + "mirror_url": null, + "archived": false, + "disabled": false, + "open_issues_count": 0, + "license": { + "key": "mit", + "name": "MIT License", + "spdx_id": "MIT", + "url": "https://api.github.com/licenses/mit", + "node_id": "MDc6TGljZW5zZTEz" + }, + "allow_forking": true, + "is_template": false, + "topics": ["pace", "running", "webapp", "website"], + "visibility": "public", + "forks": 0, + "open_issues": 0, + "watchers": 0, + "default_branch": "main", + "permissions": { + "admin": true, + "maintain": true, + "push": true, + "triage": true, + "pull": true + }, + "score": 1.0 + } + ] +}