@@ -3,7 +3,6 @@ package status
33import (
44 "errors"
55 "fmt"
6- "io"
76 "net/http"
87 "regexp"
98 "strconv"
@@ -109,33 +108,33 @@ func statusRun(opts *StatusOptions) error {
109108 fmt .Fprintf (out , "Relevant pull requests in %s\n " , ghrepo .FullName (baseRepo ))
110109 fmt .Fprintln (out , "" )
111110
112- shared .PrintHeader (cs , out , "Current branch" )
111+ shared .PrintHeader (opts . IO , "Current branch" )
113112 currentPR := prPayload .CurrentPR
114113 if currentPR != nil && currentPR .State != "OPEN" && prPayload .DefaultBranch == currentBranch {
115114 currentPR = nil
116115 }
117116 if currentPR != nil {
118- printPrs (cs , out , 1 , * currentPR )
117+ printPrs (opts . IO , 1 , * currentPR )
119118 } else if currentPRHeadRef == "" {
120- shared .PrintMessage (cs , out , " There is no current branch" )
119+ shared .PrintMessage (opts . IO , " There is no current branch" )
121120 } else {
122- shared .PrintMessage (cs , out , fmt .Sprintf (" There is no pull request associated with %s" , cs .Cyan ("[" + currentPRHeadRef + "]" )))
121+ shared .PrintMessage (opts . IO , fmt .Sprintf (" There is no pull request associated with %s" , cs .Cyan ("[" + currentPRHeadRef + "]" )))
123122 }
124123 fmt .Fprintln (out )
125124
126- shared .PrintHeader (cs , out , "Created by you" )
125+ shared .PrintHeader (opts . IO , "Created by you" )
127126 if prPayload .ViewerCreated .TotalCount > 0 {
128- printPrs (cs , out , prPayload .ViewerCreated .TotalCount , prPayload .ViewerCreated .PullRequests ... )
127+ printPrs (opts . IO , prPayload .ViewerCreated .TotalCount , prPayload .ViewerCreated .PullRequests ... )
129128 } else {
130- shared .PrintMessage (cs , out , " You have no open pull requests" )
129+ shared .PrintMessage (opts . IO , " You have no open pull requests" )
131130 }
132131 fmt .Fprintln (out )
133132
134- shared .PrintHeader (cs , out , "Requesting a code review from you" )
133+ shared .PrintHeader (opts . IO , "Requesting a code review from you" )
135134 if prPayload .ReviewRequested .TotalCount > 0 {
136- printPrs (cs , out , prPayload .ReviewRequested .TotalCount , prPayload .ReviewRequested .PullRequests ... )
135+ printPrs (opts . IO , prPayload .ReviewRequested .TotalCount , prPayload .ReviewRequested .PullRequests ... )
137136 } else {
138- shared .PrintMessage (cs , out , " You have no pull requests to review" )
137+ shared .PrintMessage (opts . IO , " You have no pull requests to review" )
139138 }
140139 fmt .Fprintln (out )
141140
@@ -179,7 +178,10 @@ func prSelectorForCurrentBranch(baseRepo ghrepo.Interface, prHeadRef string, rem
179178 return
180179}
181180
182- func printPrs (cs * iostreams.ColorScheme , w io.Writer , totalCount int , prs ... api.PullRequest ) {
181+ func printPrs (io * iostreams.IOStreams , totalCount int , prs ... api.PullRequest ) {
182+ w := io .Out
183+ cs := io .ColorScheme ()
184+
183185 for _ , pr := range prs {
184186 prNumber := fmt .Sprintf ("#%d" , pr .Number )
185187
0 commit comments