{"action":"created","comment":{"url":"https://api.github.com/repos/balasanjay/totp/pulls/comments/53379136","id":53379136,"diff_hunk":"@@ -38,13 +42,15 @@ func BarcodeImage(label string, secretkey []byte, opt *Options) ([]byte, error)\n \n \tu.RawQuery = params.Encode()\n \n-\tc, err := qr.Encode(u.String(), qr.M)\n+\tc, err := qr.Encode(u.String(), qr.ECLevelM)\n \n \tif err != nil {\n \t\treturn nil, err\n \t}\n \n-\treturn c.PNG(), nil\n+\tbuf := bytes.NewBuffer([]byte{})\n+\terr = png.Encode(buf, c.Image(8))","path":"totp.go","position":33,"original_position":33,"commit_id":"2b7a34d5581bf3a640cf2eba6e1c8cb1e6f2c49b","original_commit_id":"2b7a34d5581bf3a640cf2eba6e1c8cb1e6f2c49b","user":{"login":"balasanjay","id":630917,"avatar_url":"https://avatars.githubusercontent.com/u/630917?v=3","gravatar_id":"","url":"https://api.github.com/users/balasanjay","html_url":"https://github.com/balasanjay","followers_url":"https://api.github.com/users/balasanjay/followers","following_url":"https://api.github.com/users/balasanjay/following{/other_user}","gists_url":"https://api.github.com/users/balasanjay/gists{/gist_id}","starred_url":"https://api.github.com/users/balasanjay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balasanjay/subscriptions","organizations_url":"https://api.github.com/users/balasanjay/orgs","repos_url":"https://api.github.com/users/balasanjay/repos","events_url":"https://api.github.com/users/balasanjay/events{/privacy}","received_events_url":"https://api.github.com/users/balasanjay/received_events","type":"User","site_admin":false},"body":"I don't know if this is possible, but if png.Encode writes a partial result to the buffer, then returns an error, then we'll return a non-nil buffer and a non-nil error. To preserve the previous behavior (or atleast to make it obvious that this can't happen), can you add another error check here?","created_at":"2016-02-18T20:42:03Z","updated_at":"2016-02-18T20:42:03Z","html_url":"https://github.com/balasanjay/totp/pull/3#discussion_r53379136","pull_request_url":"https://api.github.com/repos/balasanjay/totp/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/balasanjay/totp/pulls/comments/53379136"},"html":{"href":"https://github.com/balasanjay/totp/pull/3#discussion_r53379136"},"pull_request":{"href":"https://api.github.com/repos/balasanjay/totp/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/balasanjay/totp/pulls/3","id":59856116,"html_url":"https://github.com/balasanjay/totp/pull/3","diff_url":"https://github.com/balasanjay/totp/pull/3.diff","patch_url":"https://github.com/balasanjay/totp/pull/3.patch","issue_url":"https://api.github.com/repos/balasanjay/totp/issues/3","number":3,"state":"open","locked":false,"title":"Move to the github.com/qpliu/qrencode-go/qrencode package","user":{"login":"zaphar","id":40631,"avatar_url":"https://avatars.githubusercontent.com/u/40631?v=3","gravatar_id":"","url":"https://api.github.com/users/zaphar","html_url":"https://github.com/zaphar","followers_url":"https://api.github.com/users/zaphar/followers","following_url":"https://api.github.com/users/zaphar/following{/other_user}","gists_url":"https://api.github.com/users/zaphar/gists{/gist_id}","starred_url":"https://api.github.com/users/zaphar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zaphar/subscriptions","organizations_url":"https://api.github.com/users/zaphar/orgs","repos_url":"https://api.github.com/users/zaphar/repos","events_url":"https://api.github.com/users/zaphar/events{/privacy}","received_events_url":"https://api.github.com/users/zaphar/received_events","type":"User","site_admin":false},"body":"This package is the most used and starred on gosearch which\r\nis as good a proxy as I could think of for likelihood of support\r\ngoing forward.\r\n\r\nI test generated a png and verified that it was importable into\r\ngoogle authenticator as well as the popular DUO authenticator.\r\n\r\nIt's a little more work in our code to generate the barcode but not that much really.","created_at":"2016-02-18T20:13:29Z","updated_at":"2016-02-18T20:42:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"054d0c8633b2156faad785edc5be9cfcd3fc6d9e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/balasanjay/totp/pulls/3/commits","review_comments_url":"https://api.github.com/repos/balasanjay/totp/pulls/3/comments","review_comment_url":"https://api.github.com/repos/balasanjay/totp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/balasanjay/totp/issues/3/comments","statuses_url":"https://api.github.com/repos/balasanjay/totp/statuses/2b7a34d5581bf3a640cf2eba6e1c8cb1e6f2c49b","head":{"label":"zaphar:master","ref":"master","sha":"2b7a34d5581bf3a640cf2eba6e1c8cb1e6f2c49b","user":{"login":"zaphar","id":40631,"avatar_url":"https://avatars.githubusercontent.com/u/40631?v=3","gravatar_id":"","url":"https://api.github.com/users/zaphar","html_url":"https://github.com/zaphar","followers_url":"https://api.github.com/users/zaphar/followers","following_url":"https://api.github.com/users/zaphar/following{/other_user}","gists_url":"https://api.github.com/users/zaphar/gists{/gist_id}","starred_url":"https://api.github.com/users/zaphar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zaphar/subscriptions","organizations_url":"https://api.github.com/users/zaphar/orgs","repos_url":"https://api.github.com/users/zaphar/repos","events_url":"https://api.github.com/users/zaphar/events{/privacy}","received_events_url":"https://api.github.com/users/zaphar/received_events","type":"User","site_admin":false},"repo":{"id":52019587,"name":"totp","full_name":"zaphar/totp","owner":{"login":"zaphar","id":40631,"avatar_url":"https://avatars.githubusercontent.com/u/40631?v=3","gravatar_id":"","url":"https://api.github.com/users/zaphar","html_url":"https://github.com/zaphar","followers_url":"https://api.github.com/users/zaphar/followers","following_url":"https://api.github.com/users/zaphar/following{/other_user}","gists_url":"https://api.github.com/users/zaphar/gists{/gist_id}","starred_url":"https://api.github.com/users/zaphar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zaphar/subscriptions","organizations_url":"https://api.github.com/users/zaphar/orgs","repos_url":"https://api.github.com/users/zaphar/repos","events_url":"https://api.github.com/users/zaphar/events{/privacy}","received_events_url":"https://api.github.com/users/zaphar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zaphar/totp","description":"A Go implementation of the Time-Based One Time Password (TOTP) protocol. Works with Google Authenticator.","fork":true,"url":"https://api.github.com/repos/zaphar/totp","forks_url":"https://api.github.com/repos/zaphar/totp/forks","keys_url":"https://api.github.com/repos/zaphar/totp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zaphar/totp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zaphar/totp/teams","hooks_url":"https://api.github.com/repos/zaphar/totp/hooks","issue_events_url":"https://api.github.com/repos/zaphar/totp/issues/events{/number}","events_url":"https://api.github.com/repos/zaphar/totp/events","assignees_url":"https://api.github.com/repos/zaphar/totp/assignees{/user}","branches_url":"https://api.github.com/repos/zaphar/totp/branches{/branch}","tags_url":"https://api.github.com/repos/zaphar/totp/tags","blobs_url":"https://api.github.com/repos/zaphar/totp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zaphar/totp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zaphar/totp/git/refs{/sha}","trees_url":"https://api.github.com/repos/zaphar/totp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zaphar/totp/statuses/{sha}","languages_url":"https://api.github.com/repos/zaphar/totp/languages","stargazers_url":"https://api.github.com/repos/zaphar/totp/stargazers","contributors_url":"https://api.github.com/repos/zaphar/totp/contributors","subscribers_url":"https://api.github.com/repos/zaphar/totp/subscribers","subscription_url":"https://api.github.com/repos/zaphar/totp/subscription","commits_url":"https://api.github.com/repos/zaphar/totp/commits{/sha}","git_commits_url":"https://api.github.com/repos/zaphar/totp/git/commits{/sha}","comments_url":"https://api.github.com/repos/zaphar/totp/comments{/number}","issue_comment_url":"https://api.github.com/repos/zaphar/totp/issues/comments{/number}","contents_url":"https://api.github.com/repos/zaphar/totp/contents/{+path}","compare_url":"https://api.github.com/repos/zaphar/totp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zaphar/totp/merges","archive_url":"https://api.github.com/repos/zaphar/totp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zaphar/totp/downloads","issues_url":"https://api.github.com/repos/zaphar/totp/issues{/number}","pulls_url":"https://api.github.com/repos/zaphar/totp/pulls{/number}","milestones_url":"https://api.github.com/repos/zaphar/totp/milestones{/number}","notifications_url":"https://api.github.com/repos/zaphar/totp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zaphar/totp/labels{/name}","releases_url":"https://api.github.com/repos/zaphar/totp/releases{/id}","deployments_url":"https://api.github.com/repos/zaphar/totp/deployments","created_at":"2016-02-18T16:03:55Z","updated_at":"2016-02-18T16:03:56Z","pushed_at":"2016-02-18T20:12:19Z","git_url":"git://github.com/zaphar/totp.git","ssh_url":"git@github.com:zaphar/totp.git","clone_url":"https://github.com/zaphar/totp.git","svn_url":"https://github.com/zaphar/totp","homepage":null,"size":5,"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":"balasanjay:master","ref":"master","sha":"3ac5dcd4b388f5c2e4ac334420d00b6c9a0cb09e","user":{"login":"balasanjay","id":630917,"avatar_url":"https://avatars.githubusercontent.com/u/630917?v=3","gravatar_id":"","url":"https://api.github.com/users/balasanjay","html_url":"https://github.com/balasanjay","followers_url":"https://api.github.com/users/balasanjay/followers","following_url":"https://api.github.com/users/balasanjay/following{/other_user}","gists_url":"https://api.github.com/users/balasanjay/gists{/gist_id}","starred_url":"https://api.github.com/users/balasanjay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balasanjay/subscriptions","organizations_url":"https://api.github.com/users/balasanjay/orgs","repos_url":"https://api.github.com/users/balasanjay/repos","events_url":"https://api.github.com/users/balasanjay/events{/privacy}","received_events_url":"https://api.github.com/users/balasanjay/received_events","type":"User","site_admin":false},"repo":{"id":9575338,"name":"totp","full_name":"balasanjay/totp","owner":{"login":"balasanjay","id":630917,"avatar_url":"https://avatars.githubusercontent.com/u/630917?v=3","gravatar_id":"","url":"https://api.github.com/users/balasanjay","html_url":"https://github.com/balasanjay","followers_url":"https://api.github.com/users/balasanjay/followers","following_url":"https://api.github.com/users/balasanjay/following{/other_user}","gists_url":"https://api.github.com/users/balasanjay/gists{/gist_id}","starred_url":"https://api.github.com/users/balasanjay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/balasanjay/subscriptions","organizations_url":"https://api.github.com/users/balasanjay/orgs","repos_url":"https://api.github.com/users/balasanjay/repos","events_url":"https://api.github.com/users/balasanjay/events{/privacy}","received_events_url":"https://api.github.com/users/balasanjay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/balasanjay/totp","description":"A Go implementation of the Time-Based One Time Password (TOTP) protocol. Works with Google Authenticator.","fork":false,"url":"https://api.github.com/repos/balasanjay/totp","forks_url":"https://api.github.com/repos/balasanjay/totp/forks","keys_url":"https://api.github.com/repos/balasanjay/totp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/balasanjay/totp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/balasanjay/totp/teams","hooks_url":"https://api.github.com/repos/balasanjay/totp/hooks","issue_events_url":"https://api.github.com/repos/balasanjay/totp/issues/events{/number}","events_url":"https://api.github.com/repos/balasanjay/totp/events","assignees_url":"https://api.github.com/repos/balasanjay/totp/assignees{/user}","branches_url":"https://api.github.com/repos/balasanjay/totp/branches{/branch}","tags_url":"https://api.github.com/repos/balasanjay/totp/tags","blobs_url":"https://api.github.com/repos/balasanjay/totp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/balasanjay/totp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/balasanjay/totp/git/refs{/sha}","trees_url":"https://api.github.com/repos/balasanjay/totp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/balasanjay/totp/statuses/{sha}","languages_url":"https://api.github.com/repos/balasanjay/totp/languages","stargazers_url":"https://api.github.com/repos/balasanjay/totp/stargazers","contributors_url":"https://api.github.com/repos/balasanjay/totp/contributors","subscribers_url":"https://api.github.com/repos/balasanjay/totp/subscribers","subscription_url":"https://api.github.com/repos/balasanjay/totp/subscription","commits_url":"https://api.github.com/repos/balasanjay/totp/commits{/sha}","git_commits_url":"https://api.github.com/repos/balasanjay/totp/git/commits{/sha}","comments_url":"https://api.github.com/repos/balasanjay/totp/comments{/number}","issue_comment_url":"https://api.github.com/repos/balasanjay/totp/issues/comments{/number}","contents_url":"https://api.github.com/repos/balasanjay/totp/contents/{+path}","compare_url":"https://api.github.com/repos/balasanjay/totp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/balasanjay/totp/merges","archive_url":"https://api.github.com/repos/balasanjay/totp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/balasanjay/totp/downloads","issues_url":"https://api.github.com/repos/balasanjay/totp/issues{/number}","pulls_url":"https://api.github.com/repos/balasanjay/totp/pulls{/number}","milestones_url":"https://api.github.com/repos/balasanjay/totp/milestones{/number}","notifications_url":"https://api.github.com/repos/balasanjay/totp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/balasanjay/totp/labels{/name}","releases_url":"https://api.github.com/repos/balasanjay/totp/releases{/id}","deployments_url":"https://api.github.com/repos/balasanjay/totp/deployments","created_at":"2013-04-21T05:42:38Z","updated_at":"2016-01-31T22:30:37Z","pushed_at":"2016-02-18T20:13:30Z","git_url":"git://github.com/balasanjay/totp.git","ssh_url":"git@github.com:balasanjay/totp.git","clone_url":"https://github.com/balasanjay/totp.git","svn_url":"https://github.com/balasanjay/totp","homepage":null,"size":6,"stargazers_count":41,"watchers_count":41,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":3,"forks":12,"open_issues":3,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/balasanjay/totp/pulls/3"},"html":{"href":"https://github.com/balasanjay/totp/pull/3"},"issue":{"href":"https://api.github.com/repos/balasanjay/totp/issues/3"},"comments":{"href":"https://api.github.com/repos/balasanjay/totp/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/balasanjay/totp/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/balasanjay/totp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/balasanjay/totp/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/balasanjay/totp/statuses/2b7a34d5581bf3a640cf2eba6e1c8cb1e6f2c49b"}}}}