{"action":"created","comment":{"url":"https://api.github.com/repos/miekg/dns/pulls/comments/50625900","id":50625900,"diff_hunk":"@@ -0,0 +1,91 @@\n+package dnsutil\n+\n+import \"strings\"\n+\n+// AddDomain adds origin to s if s is not already a FQDN.\n+func AddDomain(origin, s string) string {\n+\t// If you want the result to end in a \".\", pass an origin that ends in a \".\"","path":"dnsutil/util.go","position":null,"original_position":7,"commit_id":"11e19026221ede215d138d6be425e6ce84ddf2d8","original_commit_id":"5c4f542679192cb763b1fecdf4d2ad98dded4aec","user":{"login":"TomOnTime","id":1389289,"avatar_url":"https://avatars.githubusercontent.com/u/1389289?v=3","gravatar_id":"","url":"https://api.github.com/users/TomOnTime","html_url":"https://github.com/TomOnTime","followers_url":"https://api.github.com/users/TomOnTime/followers","following_url":"https://api.github.com/users/TomOnTime/following{/other_user}","gists_url":"https://api.github.com/users/TomOnTime/gists{/gist_id}","starred_url":"https://api.github.com/users/TomOnTime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomOnTime/subscriptions","organizations_url":"https://api.github.com/users/TomOnTime/orgs","repos_url":"https://api.github.com/users/TomOnTime/repos","events_url":"https://api.github.com/users/TomOnTime/events{/privacy}","received_events_url":"https://api.github.com/users/TomOnTime/received_events","type":"User","site_admin":false},"body":"I'd rather leave it as is.  Often user-facing code displays FQDNs without the trailing dot.  Being able to include (or not include) the \".\" at the end of the origin makes it easy for this one function to work in either case.  That's why I didn't call this MakeFqdn() (and AppendIfNotFqdn() is a bit convoluted).","created_at":"2016-01-23T21:29:09Z","updated_at":"2016-01-23T21:29:09Z","html_url":"https://github.com/miekg/dns/pull/302#discussion_r50625900","pull_request_url":"https://api.github.com/repos/miekg/dns/pulls/302","_links":{"self":{"href":"https://api.github.com/repos/miekg/dns/pulls/comments/50625900"},"html":{"href":"https://github.com/miekg/dns/pull/302#discussion_r50625900"},"pull_request":{"href":"https://api.github.com/repos/miekg/dns/pulls/302"}}},"pull_request":{"url":"https://api.github.com/repos/miekg/dns/pulls/302","id":55802482,"html_url":"https://github.com/miekg/dns/pull/302","diff_url":"https://github.com/miekg/dns/pull/302.diff","patch_url":"https://github.com/miekg/dns/pull/302.patch","issue_url":"https://api.github.com/repos/miekg/dns/issues/302","number":302,"state":"open","locked":false,"title":"Added new functions: TrimDomain(), AddDomain(), GenerateZoneFile()","user":{"login":"TomOnTime","id":1389289,"avatar_url":"https://avatars.githubusercontent.com/u/1389289?v=3","gravatar_id":"","url":"https://api.github.com/users/TomOnTime","html_url":"https://github.com/TomOnTime","followers_url":"https://api.github.com/users/TomOnTime/followers","following_url":"https://api.github.com/users/TomOnTime/following{/other_user}","gists_url":"https://api.github.com/users/TomOnTime/gists{/gist_id}","starred_url":"https://api.github.com/users/TomOnTime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomOnTime/subscriptions","organizations_url":"https://api.github.com/users/TomOnTime/orgs","repos_url":"https://api.github.com/users/TomOnTime/repos","events_url":"https://api.github.com/users/TomOnTime/events{/privacy}","received_events_url":"https://api.github.com/users/TomOnTime/received_events","type":"User","site_admin":false},"body":"  * TrimDomain() Trims the domain off a FQDN.\r\n  * AddDomain() Adds a domain to a shortname.\r\n  * GenerateZoneFile() Create a pretty BIND-style Zonefile.","created_at":"2016-01-12T19:09:43Z","updated_at":"2016-01-23T21:29:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53864d704f0f3732c465ac41fd90c7c2e16cae45","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/miekg/dns/pulls/302/commits","review_comments_url":"https://api.github.com/repos/miekg/dns/pulls/302/comments","review_comment_url":"https://api.github.com/repos/miekg/dns/pulls/comments{/number}","comments_url":"https://api.github.com/repos/miekg/dns/issues/302/comments","statuses_url":"https://api.github.com/repos/miekg/dns/statuses/11e19026221ede215d138d6be425e6ce84ddf2d8","head":{"label":"TomOnTime:tlim_newstuff","ref":"tlim_newstuff","sha":"11e19026221ede215d138d6be425e6ce84ddf2d8","user":{"login":"TomOnTime","id":1389289,"avatar_url":"https://avatars.githubusercontent.com/u/1389289?v=3","gravatar_id":"","url":"https://api.github.com/users/TomOnTime","html_url":"https://github.com/TomOnTime","followers_url":"https://api.github.com/users/TomOnTime/followers","following_url":"https://api.github.com/users/TomOnTime/following{/other_user}","gists_url":"https://api.github.com/users/TomOnTime/gists{/gist_id}","starred_url":"https://api.github.com/users/TomOnTime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomOnTime/subscriptions","organizations_url":"https://api.github.com/users/TomOnTime/orgs","repos_url":"https://api.github.com/users/TomOnTime/repos","events_url":"https://api.github.com/users/TomOnTime/events{/privacy}","received_events_url":"https://api.github.com/users/TomOnTime/received_events","type":"User","site_admin":false},"repo":{"id":49456708,"name":"dns","full_name":"TomOnTime/dns","owner":{"login":"TomOnTime","id":1389289,"avatar_url":"https://avatars.githubusercontent.com/u/1389289?v=3","gravatar_id":"","url":"https://api.github.com/users/TomOnTime","html_url":"https://github.com/TomOnTime","followers_url":"https://api.github.com/users/TomOnTime/followers","following_url":"https://api.github.com/users/TomOnTime/following{/other_user}","gists_url":"https://api.github.com/users/TomOnTime/gists{/gist_id}","starred_url":"https://api.github.com/users/TomOnTime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomOnTime/subscriptions","organizations_url":"https://api.github.com/users/TomOnTime/orgs","repos_url":"https://api.github.com/users/TomOnTime/repos","events_url":"https://api.github.com/users/TomOnTime/events{/privacy}","received_events_url":"https://api.github.com/users/TomOnTime/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TomOnTime/dns","description":"DNS library in Go","fork":true,"url":"https://api.github.com/repos/TomOnTime/dns","forks_url":"https://api.github.com/repos/TomOnTime/dns/forks","keys_url":"https://api.github.com/repos/TomOnTime/dns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TomOnTime/dns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TomOnTime/dns/teams","hooks_url":"https://api.github.com/repos/TomOnTime/dns/hooks","issue_events_url":"https://api.github.com/repos/TomOnTime/dns/issues/events{/number}","events_url":"https://api.github.com/repos/TomOnTime/dns/events","assignees_url":"https://api.github.com/repos/TomOnTime/dns/assignees{/user}","branches_url":"https://api.github.com/repos/TomOnTime/dns/branches{/branch}","tags_url":"https://api.github.com/repos/TomOnTime/dns/tags","blobs_url":"https://api.github.com/repos/TomOnTime/dns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TomOnTime/dns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TomOnTime/dns/git/refs{/sha}","trees_url":"https://api.github.com/repos/TomOnTime/dns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TomOnTime/dns/statuses/{sha}","languages_url":"https://api.github.com/repos/TomOnTime/dns/languages","stargazers_url":"https://api.github.com/repos/TomOnTime/dns/stargazers","contributors_url":"https://api.github.com/repos/TomOnTime/dns/contributors","subscribers_url":"https://api.github.com/repos/TomOnTime/dns/subscribers","subscription_url":"https://api.github.com/repos/TomOnTime/dns/subscription","commits_url":"https://api.github.com/repos/TomOnTime/dns/commits{/sha}","git_commits_url":"https://api.github.com/repos/TomOnTime/dns/git/commits{/sha}","comments_url":"https://api.github.com/repos/TomOnTime/dns/comments{/number}","issue_comment_url":"https://api.github.com/repos/TomOnTime/dns/issues/comments{/number}","contents_url":"https://api.github.com/repos/TomOnTime/dns/contents/{+path}","compare_url":"https://api.github.com/repos/TomOnTime/dns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TomOnTime/dns/merges","archive_url":"https://api.github.com/repos/TomOnTime/dns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TomOnTime/dns/downloads","issues_url":"https://api.github.com/repos/TomOnTime/dns/issues{/number}","pulls_url":"https://api.github.com/repos/TomOnTime/dns/pulls{/number}","milestones_url":"https://api.github.com/repos/TomOnTime/dns/milestones{/number}","notifications_url":"https://api.github.com/repos/TomOnTime/dns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TomOnTime/dns/labels{/name}","releases_url":"https://api.github.com/repos/TomOnTime/dns/releases{/id}","deployments_url":"https://api.github.com/repos/TomOnTime/dns/deployments","created_at":"2016-01-11T21:50:00Z","updated_at":"2016-01-11T21:50:01Z","pushed_at":"2016-01-23T21:28:50Z","git_url":"git://github.com/TomOnTime/dns.git","ssh_url":"git@github.com:TomOnTime/dns.git","clone_url":"https://github.com/TomOnTime/dns.git","svn_url":"https://github.com/TomOnTime/dns","homepage":"http://miek.nl/posts/2014/Aug/16/go-dns-package/","size":10586,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"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":"miekg:master","ref":"master","sha":"297a77c2fb5ebf0f261733e3c03f0c3bb9fdd917","user":{"login":"miekg","id":353371,"avatar_url":"https://avatars.githubusercontent.com/u/353371?v=3","gravatar_id":"","url":"https://api.github.com/users/miekg","html_url":"https://github.com/miekg","followers_url":"https://api.github.com/users/miekg/followers","following_url":"https://api.github.com/users/miekg/following{/other_user}","gists_url":"https://api.github.com/users/miekg/gists{/gist_id}","starred_url":"https://api.github.com/users/miekg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miekg/subscriptions","organizations_url":"https://api.github.com/users/miekg/orgs","repos_url":"https://api.github.com/users/miekg/repos","events_url":"https://api.github.com/users/miekg/events{/privacy}","received_events_url":"https://api.github.com/users/miekg/received_events","type":"User","site_admin":false},"repo":{"id":815644,"name":"dns","full_name":"miekg/dns","owner":{"login":"miekg","id":353371,"avatar_url":"https://avatars.githubusercontent.com/u/353371?v=3","gravatar_id":"","url":"https://api.github.com/users/miekg","html_url":"https://github.com/miekg","followers_url":"https://api.github.com/users/miekg/followers","following_url":"https://api.github.com/users/miekg/following{/other_user}","gists_url":"https://api.github.com/users/miekg/gists{/gist_id}","starred_url":"https://api.github.com/users/miekg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miekg/subscriptions","organizations_url":"https://api.github.com/users/miekg/orgs","repos_url":"https://api.github.com/users/miekg/repos","events_url":"https://api.github.com/users/miekg/events{/privacy}","received_events_url":"https://api.github.com/users/miekg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/miekg/dns","description":"DNS library in Go","fork":false,"url":"https://api.github.com/repos/miekg/dns","forks_url":"https://api.github.com/repos/miekg/dns/forks","keys_url":"https://api.github.com/repos/miekg/dns/keys{/key_id}","collaborators_url":"https://api.github.com/repos/miekg/dns/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/miekg/dns/teams","hooks_url":"https://api.github.com/repos/miekg/dns/hooks","issue_events_url":"https://api.github.com/repos/miekg/dns/issues/events{/number}","events_url":"https://api.github.com/repos/miekg/dns/events","assignees_url":"https://api.github.com/repos/miekg/dns/assignees{/user}","branches_url":"https://api.github.com/repos/miekg/dns/branches{/branch}","tags_url":"https://api.github.com/repos/miekg/dns/tags","blobs_url":"https://api.github.com/repos/miekg/dns/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/miekg/dns/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/miekg/dns/git/refs{/sha}","trees_url":"https://api.github.com/repos/miekg/dns/git/trees{/sha}","statuses_url":"https://api.github.com/repos/miekg/dns/statuses/{sha}","languages_url":"https://api.github.com/repos/miekg/dns/languages","stargazers_url":"https://api.github.com/repos/miekg/dns/stargazers","contributors_url":"https://api.github.com/repos/miekg/dns/contributors","subscribers_url":"https://api.github.com/repos/miekg/dns/subscribers","subscription_url":"https://api.github.com/repos/miekg/dns/subscription","commits_url":"https://api.github.com/repos/miekg/dns/commits{/sha}","git_commits_url":"https://api.github.com/repos/miekg/dns/git/commits{/sha}","comments_url":"https://api.github.com/repos/miekg/dns/comments{/number}","issue_comment_url":"https://api.github.com/repos/miekg/dns/issues/comments{/number}","contents_url":"https://api.github.com/repos/miekg/dns/contents/{+path}","compare_url":"https://api.github.com/repos/miekg/dns/compare/{base}...{head}","merges_url":"https://api.github.com/repos/miekg/dns/merges","archive_url":"https://api.github.com/repos/miekg/dns/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/miekg/dns/downloads","issues_url":"https://api.github.com/repos/miekg/dns/issues{/number}","pulls_url":"https://api.github.com/repos/miekg/dns/pulls{/number}","milestones_url":"https://api.github.com/repos/miekg/dns/milestones{/number}","notifications_url":"https://api.github.com/repos/miekg/dns/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/miekg/dns/labels{/name}","releases_url":"https://api.github.com/repos/miekg/dns/releases{/id}","deployments_url":"https://api.github.com/repos/miekg/dns/deployments","created_at":"2010-08-03T21:56:23Z","updated_at":"2016-01-23T03:31:10Z","pushed_at":"2016-01-23T21:28:52Z","git_url":"git://github.com/miekg/dns.git","ssh_url":"git@github.com:miekg/dns.git","clone_url":"https://github.com/miekg/dns.git","svn_url":"https://github.com/miekg/dns","homepage":"http://miek.nl/posts/2014/Aug/16/go-dns-package/","size":12196,"stargazers_count":1315,"watchers_count":1315,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":233,"mirror_url":null,"open_issues_count":8,"forks":233,"open_issues":8,"watchers":1315,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/miekg/dns/pulls/302"},"html":{"href":"https://github.com/miekg/dns/pull/302"},"issue":{"href":"https://api.github.com/repos/miekg/dns/issues/302"},"comments":{"href":"https://api.github.com/repos/miekg/dns/issues/302/comments"},"review_comments":{"href":"https://api.github.com/repos/miekg/dns/pulls/302/comments"},"review_comment":{"href":"https://api.github.com/repos/miekg/dns/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/miekg/dns/pulls/302/commits"},"statuses":{"href":"https://api.github.com/repos/miekg/dns/statuses/11e19026221ede215d138d6be425e6ce84ddf2d8"}}}}