{"action":"created","comment":{"url":"https://api.github.com/repos/hpcloud/termui/pulls/comments/79691151","id":79691151,"diff_hunk":"@@ -0,0 +1,54 @@\n+package termui\n+\n+import \"github.com/fatih/color\"\n+\n+// These mirror their equivalent functions in ui.go\n+// Unfortunately since Print is already variadic,\n+// we can't have an elegant \"...color.Attribute\" argument and have to use a slice","path":"color.go","position":7,"original_position":7,"commit_id":"7157f75c44e5dad7bc8302c1145314aec92e7a81","original_commit_id":"7157f75c44e5dad7bc8302c1145314aec92e7a81","user":{"login":"WGautier","id":4239293,"avatar_url":"https://avatars.githubusercontent.com/u/4239293?v=3","gravatar_id":"","url":"https://api.github.com/users/WGautier","html_url":"https://github.com/WGautier","followers_url":"https://api.github.com/users/WGautier/followers","following_url":"https://api.github.com/users/WGautier/following{/other_user}","gists_url":"https://api.github.com/users/WGautier/gists{/gist_id}","starred_url":"https://api.github.com/users/WGautier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WGautier/subscriptions","organizations_url":"https://api.github.com/users/WGautier/orgs","repos_url":"https://api.github.com/users/WGautier/repos","events_url":"https://api.github.com/users/WGautier/events{/privacy}","received_events_url":"https://api.github.com/users/WGautier/received_events","type":"User","site_admin":false},"body":"I thought of that too, but figured it was a little hacky. Maybe ease of use is worth more...\r\n\r\nBut what if I want to print the value of a  `color.Attribute` :stuck_out_tongue: ","created_at":"2016-09-20T19:20:46Z","updated_at":"2016-09-20T19:20:46Z","html_url":"https://github.com/hpcloud/termui/pull/6#discussion_r79691151","pull_request_url":"https://api.github.com/repos/hpcloud/termui/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/hpcloud/termui/pulls/comments/79691151"},"html":{"href":"https://github.com/hpcloud/termui/pull/6#discussion_r79691151"},"pull_request":{"href":"https://api.github.com/repos/hpcloud/termui/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/hpcloud/termui/pulls/6","id":86026970,"html_url":"https://github.com/hpcloud/termui/pull/6","diff_url":"https://github.com/hpcloud/termui/pull/6.diff","patch_url":"https://github.com/hpcloud/termui/pull/6.patch","issue_url":"https://api.github.com/repos/hpcloud/termui/issues/6","number":6,"state":"open","locked":false,"title":"Add some convenient color helpers","user":{"login":"WGautier","id":4239293,"avatar_url":"https://avatars.githubusercontent.com/u/4239293?v=3","gravatar_id":"","url":"https://api.github.com/users/WGautier","html_url":"https://github.com/WGautier","followers_url":"https://api.github.com/users/WGautier/followers","following_url":"https://api.github.com/users/WGautier/following{/other_user}","gists_url":"https://api.github.com/users/WGautier/gists{/gist_id}","starred_url":"https://api.github.com/users/WGautier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WGautier/subscriptions","organizations_url":"https://api.github.com/users/WGautier/orgs","repos_url":"https://api.github.com/users/WGautier/repos","events_url":"https://api.github.com/users/WGautier/events{/privacy}","received_events_url":"https://api.github.com/users/WGautier/received_events","type":"User","site_admin":false},"body":"For instance, in my current CLI, this would let me turn this:\r\n\r\n```go\r\nredBoldColor := color.New(color.FgRed, color.Bold).SprintfFunc()\r\nfailureName := redBoldColor(\"%s: Failed with code %d\", failedResult.TestFile, failedResult.ExitCode)\r\nui.Println(failureName)\r\nfailureString := fmt.Sprintf(\"Output:\\n%s\", failedResult.Output)\r\nfailureString = color.RedString(failureString)\r\nui.Println(failureString)\r\n```\r\n\r\nInto this:\r\n```go\r\nui.RedBoldPrintln(\"%s: Failed with code %d\", failedResult.TestFile, failedResult.ExitCode)\r\nui.RedPrintln(\"Output:\\n%s\", failedResult.Output)\r\n```\r\n\r\nIt also lets me remove a direct dependency to `github.com/fatih/color`","created_at":"2016-09-20T18:07:53Z","updated_at":"2016-09-20T19:20:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b4c0e163499554a589142256c242f281a87338c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/hpcloud/termui/pulls/6/commits","review_comments_url":"https://api.github.com/repos/hpcloud/termui/pulls/6/comments","review_comment_url":"https://api.github.com/repos/hpcloud/termui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hpcloud/termui/issues/6/comments","statuses_url":"https://api.github.com/repos/hpcloud/termui/statuses/7157f75c44e5dad7bc8302c1145314aec92e7a81","head":{"label":"hpcloud:add-color-helpers","ref":"add-color-helpers","sha":"7157f75c44e5dad7bc8302c1145314aec92e7a81","user":{"login":"hpcloud","id":366390,"avatar_url":"https://avatars.githubusercontent.com/u/366390?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcloud","html_url":"https://github.com/hpcloud","followers_url":"https://api.github.com/users/hpcloud/followers","following_url":"https://api.github.com/users/hpcloud/following{/other_user}","gists_url":"https://api.github.com/users/hpcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcloud/subscriptions","organizations_url":"https://api.github.com/users/hpcloud/orgs","repos_url":"https://api.github.com/users/hpcloud/repos","events_url":"https://api.github.com/users/hpcloud/events{/privacy}","received_events_url":"https://api.github.com/users/hpcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":46297412,"name":"termui","full_name":"hpcloud/termui","owner":{"login":"hpcloud","id":366390,"avatar_url":"https://avatars.githubusercontent.com/u/366390?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcloud","html_url":"https://github.com/hpcloud","followers_url":"https://api.github.com/users/hpcloud/followers","following_url":"https://api.github.com/users/hpcloud/following{/other_user}","gists_url":"https://api.github.com/users/hpcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcloud/subscriptions","organizations_url":"https://api.github.com/users/hpcloud/orgs","repos_url":"https://api.github.com/users/hpcloud/repos","events_url":"https://api.github.com/users/hpcloud/events{/privacy}","received_events_url":"https://api.github.com/users/hpcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpcloud/termui","description":"Terminal UI library","fork":false,"url":"https://api.github.com/repos/hpcloud/termui","forks_url":"https://api.github.com/repos/hpcloud/termui/forks","keys_url":"https://api.github.com/repos/hpcloud/termui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpcloud/termui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpcloud/termui/teams","hooks_url":"https://api.github.com/repos/hpcloud/termui/hooks","issue_events_url":"https://api.github.com/repos/hpcloud/termui/issues/events{/number}","events_url":"https://api.github.com/repos/hpcloud/termui/events","assignees_url":"https://api.github.com/repos/hpcloud/termui/assignees{/user}","branches_url":"https://api.github.com/repos/hpcloud/termui/branches{/branch}","tags_url":"https://api.github.com/repos/hpcloud/termui/tags","blobs_url":"https://api.github.com/repos/hpcloud/termui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpcloud/termui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpcloud/termui/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpcloud/termui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpcloud/termui/statuses/{sha}","languages_url":"https://api.github.com/repos/hpcloud/termui/languages","stargazers_url":"https://api.github.com/repos/hpcloud/termui/stargazers","contributors_url":"https://api.github.com/repos/hpcloud/termui/contributors","subscribers_url":"https://api.github.com/repos/hpcloud/termui/subscribers","subscription_url":"https://api.github.com/repos/hpcloud/termui/subscription","commits_url":"https://api.github.com/repos/hpcloud/termui/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpcloud/termui/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpcloud/termui/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpcloud/termui/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpcloud/termui/contents/{+path}","compare_url":"https://api.github.com/repos/hpcloud/termui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpcloud/termui/merges","archive_url":"https://api.github.com/repos/hpcloud/termui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpcloud/termui/downloads","issues_url":"https://api.github.com/repos/hpcloud/termui/issues{/number}","pulls_url":"https://api.github.com/repos/hpcloud/termui/pulls{/number}","milestones_url":"https://api.github.com/repos/hpcloud/termui/milestones{/number}","notifications_url":"https://api.github.com/repos/hpcloud/termui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpcloud/termui/labels{/name}","releases_url":"https://api.github.com/repos/hpcloud/termui/releases{/id}","deployments_url":"https://api.github.com/repos/hpcloud/termui/deployments","created_at":"2015-11-16T19:35:05Z","updated_at":"2016-08-08T08:02:37Z","pushed_at":"2016-09-20T18:49:47Z","git_url":"git://github.com/hpcloud/termui.git","ssh_url":"git@github.com:hpcloud/termui.git","clone_url":"https://github.com/hpcloud/termui.git","svn_url":"https://github.com/hpcloud/termui","homepage":"","size":45,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"hpcloud:master","ref":"master","sha":"6bc49a4ab6ae0acddda826f09df62d1fb7df97e5","user":{"login":"hpcloud","id":366390,"avatar_url":"https://avatars.githubusercontent.com/u/366390?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcloud","html_url":"https://github.com/hpcloud","followers_url":"https://api.github.com/users/hpcloud/followers","following_url":"https://api.github.com/users/hpcloud/following{/other_user}","gists_url":"https://api.github.com/users/hpcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcloud/subscriptions","organizations_url":"https://api.github.com/users/hpcloud/orgs","repos_url":"https://api.github.com/users/hpcloud/repos","events_url":"https://api.github.com/users/hpcloud/events{/privacy}","received_events_url":"https://api.github.com/users/hpcloud/received_events","type":"Organization","site_admin":false},"repo":{"id":46297412,"name":"termui","full_name":"hpcloud/termui","owner":{"login":"hpcloud","id":366390,"avatar_url":"https://avatars.githubusercontent.com/u/366390?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcloud","html_url":"https://github.com/hpcloud","followers_url":"https://api.github.com/users/hpcloud/followers","following_url":"https://api.github.com/users/hpcloud/following{/other_user}","gists_url":"https://api.github.com/users/hpcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcloud/subscriptions","organizations_url":"https://api.github.com/users/hpcloud/orgs","repos_url":"https://api.github.com/users/hpcloud/repos","events_url":"https://api.github.com/users/hpcloud/events{/privacy}","received_events_url":"https://api.github.com/users/hpcloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpcloud/termui","description":"Terminal UI library","fork":false,"url":"https://api.github.com/repos/hpcloud/termui","forks_url":"https://api.github.com/repos/hpcloud/termui/forks","keys_url":"https://api.github.com/repos/hpcloud/termui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpcloud/termui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpcloud/termui/teams","hooks_url":"https://api.github.com/repos/hpcloud/termui/hooks","issue_events_url":"https://api.github.com/repos/hpcloud/termui/issues/events{/number}","events_url":"https://api.github.com/repos/hpcloud/termui/events","assignees_url":"https://api.github.com/repos/hpcloud/termui/assignees{/user}","branches_url":"https://api.github.com/repos/hpcloud/termui/branches{/branch}","tags_url":"https://api.github.com/repos/hpcloud/termui/tags","blobs_url":"https://api.github.com/repos/hpcloud/termui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpcloud/termui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpcloud/termui/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpcloud/termui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpcloud/termui/statuses/{sha}","languages_url":"https://api.github.com/repos/hpcloud/termui/languages","stargazers_url":"https://api.github.com/repos/hpcloud/termui/stargazers","contributors_url":"https://api.github.com/repos/hpcloud/termui/contributors","subscribers_url":"https://api.github.com/repos/hpcloud/termui/subscribers","subscription_url":"https://api.github.com/repos/hpcloud/termui/subscription","commits_url":"https://api.github.com/repos/hpcloud/termui/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpcloud/termui/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpcloud/termui/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpcloud/termui/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpcloud/termui/contents/{+path}","compare_url":"https://api.github.com/repos/hpcloud/termui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpcloud/termui/merges","archive_url":"https://api.github.com/repos/hpcloud/termui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpcloud/termui/downloads","issues_url":"https://api.github.com/repos/hpcloud/termui/issues{/number}","pulls_url":"https://api.github.com/repos/hpcloud/termui/pulls{/number}","milestones_url":"https://api.github.com/repos/hpcloud/termui/milestones{/number}","notifications_url":"https://api.github.com/repos/hpcloud/termui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpcloud/termui/labels{/name}","releases_url":"https://api.github.com/repos/hpcloud/termui/releases{/id}","deployments_url":"https://api.github.com/repos/hpcloud/termui/deployments","created_at":"2015-11-16T19:35:05Z","updated_at":"2016-08-08T08:02:37Z","pushed_at":"2016-09-20T18:49:47Z","git_url":"git://github.com/hpcloud/termui.git","ssh_url":"git@github.com:hpcloud/termui.git","clone_url":"https://github.com/hpcloud/termui.git","svn_url":"https://github.com/hpcloud/termui","homepage":"","size":45,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hpcloud/termui/pulls/6"},"html":{"href":"https://github.com/hpcloud/termui/pull/6"},"issue":{"href":"https://api.github.com/repos/hpcloud/termui/issues/6"},"comments":{"href":"https://api.github.com/repos/hpcloud/termui/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/hpcloud/termui/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/hpcloud/termui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hpcloud/termui/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/hpcloud/termui/statuses/7157f75c44e5dad7bc8302c1145314aec92e7a81"}}}}
{"actor":{"display_login":"WGautier"}}