Fix utility function scopes
This commit is contained in:
parent
e85259d84f
commit
46a632c8f6
2 changed files with 5 additions and 5 deletions
|
|
@ -248,7 +248,7 @@ func issueView(cmd *cobra.Command, args []string) error {
|
|||
|
||||
}
|
||||
|
||||
func IssueStateTitleWithColor(state string) string {
|
||||
func issueStateTitleWithColor(state string) string {
|
||||
colorFunc := utils.ColorFuncForState(state)
|
||||
return colorFunc(strings.Title(strings.ToLower(state)))
|
||||
}
|
||||
|
|
@ -258,7 +258,7 @@ func printIssuePreview(out io.Writer, issue *api.Issue) error {
|
|||
ago := now.Sub(issue.CreatedAt)
|
||||
|
||||
fmt.Fprintln(out, utils.Bold(issue.Title))
|
||||
fmt.Fprintf(out, "%s", IssueStateTitleWithColor(issue.State))
|
||||
fmt.Fprintf(out, "%s", issueStateTitleWithColor(issue.State))
|
||||
fmt.Fprintln(out, utils.Gray(fmt.Sprintf(
|
||||
" • %s opened %s • %s",
|
||||
issue.Author.Login,
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ func prList(cmd *cobra.Command, args []string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func PRStateTitleWithColor(pr api.PullRequest) string {
|
||||
func prStateTitleWithColor(pr api.PullRequest) string {
|
||||
prStateColorFunc := colorFuncForPR(pr)
|
||||
return prStateColorFunc(strings.Title(strings.ToLower(pr.State)))
|
||||
}
|
||||
|
|
@ -302,7 +302,7 @@ func prView(cmd *cobra.Command, args []string) error {
|
|||
|
||||
func printPrPreview(out io.Writer, pr *api.PullRequest) error {
|
||||
fmt.Fprintln(out, utils.Bold(pr.Title))
|
||||
fmt.Fprintf(out, "%s", PRStateTitleWithColor(*pr))
|
||||
fmt.Fprintf(out, "%s", prStateTitleWithColor(*pr))
|
||||
fmt.Fprintln(out, utils.Gray(fmt.Sprintf(
|
||||
" • %s wants to merge %s into %s from %s",
|
||||
pr.Author.Login,
|
||||
|
|
@ -427,7 +427,7 @@ func printPrs(w io.Writer, totalCount int, prs ...api.PullRequest) {
|
|||
fmt.Fprintf(w, " - %s", utils.Green("Approved"))
|
||||
}
|
||||
} else {
|
||||
fmt.Fprintf(w, " - %s", PRStateTitleWithColor(pr))
|
||||
fmt.Fprintf(w, " - %s", prStateTitleWithColor(pr))
|
||||
}
|
||||
|
||||
fmt.Fprint(w, "\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue