{"action":"closed","number":1103,"pull_request":{"url":"https://api.github.com/repos/TykTechnologies/tyk/pulls/1103","id":140532991,"html_url":"https://github.com/TykTechnologies/tyk/pull/1103","diff_url":"https://github.com/TykTechnologies/tyk/pull/1103.diff","patch_url":"https://github.com/TykTechnologies/tyk/pull/1103.patch","issue_url":"https://api.github.com/repos/TykTechnologies/tyk/issues/1103","number":1103,"state":"closed","locked":false,"title":"all: simplify some string handling","user":{"login":"mvdan","id":3576549,"avatar_url":"https://avatars0.githubusercontent.com/u/3576549?v=4","gravatar_id":"","url":"https://api.github.com/users/mvdan","html_url":"https://github.com/mvdan","followers_url":"https://api.github.com/users/mvdan/followers","following_url":"https://api.github.com/users/mvdan/following{/other_user}","gists_url":"https://api.github.com/users/mvdan/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdan/subscriptions","organizations_url":"https://api.github.com/users/mvdan/orgs","repos_url":"https://api.github.com/users/mvdan/repos","events_url":"https://api.github.com/users/mvdan/events{/privacy}","received_events_url":"https://api.github.com/users/mvdan/received_events","type":"User","site_admin":false},"body":"Use prefix and suffix matches instead of Contains when that's what we\r\nwant.\r\n\r\nAlso refactor some manual string handling to get the first part of a URL\r\npath. It is much clearer, as well as more foolproof, to use\r\nstrings.Split and a loop. For example, the old code worked with /v1/foo\r\nbut not with //v1/foo - and of course was more complex.","created_at":"2017-09-12T09:42:48Z","updated_at":"2017-09-12T09:45:11Z","closed_at":"2017-09-12T09:45:11Z","merged_at":"2017-09-12T09:45:11Z","merge_commit_sha":"62daa2b60cec321322b46127ee298021c66370d6","assignee":null,"assignees":[],"requested_reviewers":[{"login":"buger","id":14009,"avatar_url":"https://avatars2.githubusercontent.com/u/14009?v=4","gravatar_id":"","url":"https://api.github.com/users/buger","html_url":"https://github.com/buger","followers_url":"https://api.github.com/users/buger/followers","following_url":"https://api.github.com/users/buger/following{/other_user}","gists_url":"https://api.github.com/users/buger/gists{/gist_id}","starred_url":"https://api.github.com/users/buger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buger/subscriptions","organizations_url":"https://api.github.com/users/buger/orgs","repos_url":"https://api.github.com/users/buger/repos","events_url":"https://api.github.com/users/buger/events{/privacy}","received_events_url":"https://api.github.com/users/buger/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/TykTechnologies/tyk/pulls/1103/commits","review_comments_url":"https://api.github.com/repos/TykTechnologies/tyk/pulls/1103/comments","review_comment_url":"https://api.github.com/repos/TykTechnologies/tyk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TykTechnologies/tyk/issues/1103/comments","statuses_url":"https://api.github.com/repos/TykTechnologies/tyk/statuses/1b9a4ae8b1af43ca1b8b4fbed7c2ef3296120138","head":{"label":"mvdan:strings","ref":"strings","sha":"1b9a4ae8b1af43ca1b8b4fbed7c2ef3296120138","user":{"login":"mvdan","id":3576549,"avatar_url":"https://avatars0.githubusercontent.com/u/3576549?v=4","gravatar_id":"","url":"https://api.github.com/users/mvdan","html_url":"https://github.com/mvdan","followers_url":"https://api.github.com/users/mvdan/followers","following_url":"https://api.github.com/users/mvdan/following{/other_user}","gists_url":"https://api.github.com/users/mvdan/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdan/subscriptions","organizations_url":"https://api.github.com/users/mvdan/orgs","repos_url":"https://api.github.com/users/mvdan/repos","events_url":"https://api.github.com/users/mvdan/events{/privacy}","received_events_url":"https://api.github.com/users/mvdan/received_events","type":"User","site_admin":false},"repo":{"id":78127498,"name":"tyk","full_name":"mvdan/tyk","owner":{"login":"mvdan","id":3576549,"avatar_url":"https://avatars0.githubusercontent.com/u/3576549?v=4","gravatar_id":"","url":"https://api.github.com/users/mvdan","html_url":"https://github.com/mvdan","followers_url":"https://api.github.com/users/mvdan/followers","following_url":"https://api.github.com/users/mvdan/following{/other_user}","gists_url":"https://api.github.com/users/mvdan/gists{/gist_id}","starred_url":"https://api.github.com/users/mvdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvdan/subscriptions","organizations_url":"https://api.github.com/users/mvdan/orgs","repos_url":"https://api.github.com/users/mvdan/repos","events_url":"https://api.github.com/users/mvdan/events{/privacy}","received_events_url":"https://api.github.com/users/mvdan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mvdan/tyk","description":"Tyk Open Source API Gateway written in Go","fork":true,"url":"https://api.github.com/repos/mvdan/tyk","forks_url":"https://api.github.com/repos/mvdan/tyk/forks","keys_url":"https://api.github.com/repos/mvdan/tyk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mvdan/tyk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mvdan/tyk/teams","hooks_url":"https://api.github.com/repos/mvdan/tyk/hooks","issue_events_url":"https://api.github.com/repos/mvdan/tyk/issues/events{/number}","events_url":"https://api.github.com/repos/mvdan/tyk/events","assignees_url":"https://api.github.com/repos/mvdan/tyk/assignees{/user}","branches_url":"https://api.github.com/repos/mvdan/tyk/branches{/branch}","tags_url":"https://api.github.com/repos/mvdan/tyk/tags","blobs_url":"https://api.github.com/repos/mvdan/tyk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mvdan/tyk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mvdan/tyk/git/refs{/sha}","trees_url":"https://api.github.com/repos/mvdan/tyk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mvdan/tyk/statuses/{sha}","languages_url":"https://api.github.com/repos/mvdan/tyk/languages","stargazers_url":"https://api.github.com/repos/mvdan/tyk/stargazers","contributors_url":"https://api.github.com/repos/mvdan/tyk/contributors","subscribers_url":"https://api.github.com/repos/mvdan/tyk/subscribers","subscription_url":"https://api.github.com/repos/mvdan/tyk/subscription","commits_url":"https://api.github.com/repos/mvdan/tyk/commits{/sha}","git_commits_url":"https://api.github.com/repos/mvdan/tyk/git/commits{/sha}","comments_url":"https://api.github.com/repos/mvdan/tyk/comments{/number}","issue_comment_url":"https://api.github.com/repos/mvdan/tyk/issues/comments{/number}","contents_url":"https://api.github.com/repos/mvdan/tyk/contents/{+path}","compare_url":"https://api.github.com/repos/mvdan/tyk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mvdan/tyk/merges","archive_url":"https://api.github.com/repos/mvdan/tyk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mvdan/tyk/downloads","issues_url":"https://api.github.com/repos/mvdan/tyk/issues{/number}","pulls_url":"https://api.github.com/repos/mvdan/tyk/pulls{/number}","milestones_url":"https://api.github.com/repos/mvdan/tyk/milestones{/number}","notifications_url":"https://api.github.com/repos/mvdan/tyk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mvdan/tyk/labels{/name}","releases_url":"https://api.github.com/repos/mvdan/tyk/releases{/id}","deployments_url":"https://api.github.com/repos/mvdan/tyk/deployments","created_at":"2017-01-05T16:04:33Z","updated_at":"2017-01-05T16:04:37Z","pushed_at":"2017-09-12T09:42:35Z","git_url":"git://github.com/mvdan/tyk.git","ssh_url":"git@github.com:mvdan/tyk.git","clone_url":"https://github.com/mvdan/tyk.git","svn_url":"https://github.com/mvdan/tyk","homepage":"","size":116085,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"TykTechnologies:master","ref":"master","sha":"288a31ad5c282df00d975983bd5c2e0cdd5bacf8","user":{"login":"TykTechnologies","id":16121529,"avatar_url":"https://avatars3.githubusercontent.com/u/16121529?v=4","gravatar_id":"","url":"https://api.github.com/users/TykTechnologies","html_url":"https://github.com/TykTechnologies","followers_url":"https://api.github.com/users/TykTechnologies/followers","following_url":"https://api.github.com/users/TykTechnologies/following{/other_user}","gists_url":"https://api.github.com/users/TykTechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/TykTechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TykTechnologies/subscriptions","organizations_url":"https://api.github.com/users/TykTechnologies/orgs","repos_url":"https://api.github.com/users/TykTechnologies/repos","events_url":"https://api.github.com/users/TykTechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/TykTechnologies/received_events","type":"Organization","site_admin":false},"repo":{"id":19537979,"name":"tyk","full_name":"TykTechnologies/tyk","owner":{"login":"TykTechnologies","id":16121529,"avatar_url":"https://avatars3.githubusercontent.com/u/16121529?v=4","gravatar_id":"","url":"https://api.github.com/users/TykTechnologies","html_url":"https://github.com/TykTechnologies","followers_url":"https://api.github.com/users/TykTechnologies/followers","following_url":"https://api.github.com/users/TykTechnologies/following{/other_user}","gists_url":"https://api.github.com/users/TykTechnologies/gists{/gist_id}","starred_url":"https://api.github.com/users/TykTechnologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TykTechnologies/subscriptions","organizations_url":"https://api.github.com/users/TykTechnologies/orgs","repos_url":"https://api.github.com/users/TykTechnologies/repos","events_url":"https://api.github.com/users/TykTechnologies/events{/privacy}","received_events_url":"https://api.github.com/users/TykTechnologies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TykTechnologies/tyk","description":"Tyk Open Source API Gateway written in Go","fork":false,"url":"https://api.github.com/repos/TykTechnologies/tyk","forks_url":"https://api.github.com/repos/TykTechnologies/tyk/forks","keys_url":"https://api.github.com/repos/TykTechnologies/tyk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TykTechnologies/tyk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TykTechnologies/tyk/teams","hooks_url":"https://api.github.com/repos/TykTechnologies/tyk/hooks","issue_events_url":"https://api.github.com/repos/TykTechnologies/tyk/issues/events{/number}","events_url":"https://api.github.com/repos/TykTechnologies/tyk/events","assignees_url":"https://api.github.com/repos/TykTechnologies/tyk/assignees{/user}","branches_url":"https://api.github.com/repos/TykTechnologies/tyk/branches{/branch}","tags_url":"https://api.github.com/repos/TykTechnologies/tyk/tags","blobs_url":"https://api.github.com/repos/TykTechnologies/tyk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TykTechnologies/tyk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TykTechnologies/tyk/git/refs{/sha}","trees_url":"https://api.github.com/repos/TykTechnologies/tyk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TykTechnologies/tyk/statuses/{sha}","languages_url":"https://api.github.com/repos/TykTechnologies/tyk/languages","stargazers_url":"https://api.github.com/repos/TykTechnologies/tyk/stargazers","contributors_url":"https://api.github.com/repos/TykTechnologies/tyk/contributors","subscribers_url":"https://api.github.com/repos/TykTechnologies/tyk/subscribers","subscription_url":"https://api.github.com/repos/TykTechnologies/tyk/subscription","commits_url":"https://api.github.com/repos/TykTechnologies/tyk/commits{/sha}","git_commits_url":"https://api.github.com/repos/TykTechnologies/tyk/git/commits{/sha}","comments_url":"https://api.github.com/repos/TykTechnologies/tyk/comments{/number}","issue_comment_url":"https://api.github.com/repos/TykTechnologies/tyk/issues/comments{/number}","contents_url":"https://api.github.com/repos/TykTechnologies/tyk/contents/{+path}","compare_url":"https://api.github.com/repos/TykTechnologies/tyk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TykTechnologies/tyk/merges","archive_url":"https://api.github.com/repos/TykTechnologies/tyk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TykTechnologies/tyk/downloads","issues_url":"https://api.github.com/repos/TykTechnologies/tyk/issues{/number}","pulls_url":"https://api.github.com/repos/TykTechnologies/tyk/pulls{/number}","milestones_url":"https://api.github.com/repos/TykTechnologies/tyk/milestones{/number}","notifications_url":"https://api.github.com/repos/TykTechnologies/tyk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TykTechnologies/tyk/labels{/name}","releases_url":"https://api.github.com/repos/TykTechnologies/tyk/releases{/id}","deployments_url":"https://api.github.com/repos/TykTechnologies/tyk/deployments","created_at":"2014-05-07T14:38:24Z","updated_at":"2017-09-12T01:35:26Z","pushed_at":"2017-09-12T09:45:11Z","git_url":"git://github.com/TykTechnologies/tyk.git","ssh_url":"git@github.com:TykTechnologies/tyk.git","clone_url":"https://github.com/TykTechnologies/tyk.git","svn_url":"https://github.com/TykTechnologies/tyk","homepage":"","size":116662,"stargazers_count":2318,"watchers_count":2318,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":374,"mirror_url":null,"open_issues_count":199,"forks":374,"open_issues":199,"watchers":2318,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TykTechnologies/tyk/pulls/1103"},"html":{"href":"https://github.com/TykTechnologies/tyk/pull/1103"},"issue":{"href":"https://api.github.com/repos/TykTechnologies/tyk/issues/1103"},"comments":{"href":"https://api.github.com/repos/TykTechnologies/tyk/issues/1103/comments"},"review_comments":{"href":"https://api.github.com/repos/TykTechnologies/tyk/pulls/1103/comments"},"review_comment":{"href":"https://api.github.com/repos/TykTechnologies/tyk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TykTechnologies/tyk/pulls/1103/commits"},"statuses":{"href":"https://api.github.com/repos/TykTechnologies/tyk/statuses/1b9a4ae8b1af43ca1b8b4fbed7c2ef3296120138"}},"author_association":"MEMBER","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"buger","id":14009,"avatar_url":"https://avatars2.githubusercontent.com/u/14009?v=4","gravatar_id":"","url":"https://api.github.com/users/buger","html_url":"https://github.com/buger","followers_url":"https://api.github.com/users/buger/followers","following_url":"https://api.github.com/users/buger/following{/other_user}","gists_url":"https://api.github.com/users/buger/gists{/gist_id}","starred_url":"https://api.github.com/users/buger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buger/subscriptions","organizations_url":"https://api.github.com/users/buger/orgs","repos_url":"https://api.github.com/users/buger/repos","events_url":"https://api.github.com/users/buger/events{/privacy}","received_events_url":"https://api.github.com/users/buger/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":8,"deletions":16,"changed_files":3}}
{"actor":{"display_login":"buger"}}