Avoid using named return in PR ChecksStatus
See: https://dave.cheney.net/practical-go/presentations/gophercon-israel.html#_avoid_named_return_values
This commit is contained in:
parent
c4bb344ddd
commit
bfb5e8f1d6
1 changed files with 5 additions and 3 deletions
|
|
@ -261,9 +261,11 @@ type PullRequestChecksStatus struct {
|
|||
Total int
|
||||
}
|
||||
|
||||
func (pr *PullRequest) ChecksStatus() (summary PullRequestChecksStatus) {
|
||||
func (pr *PullRequest) ChecksStatus() PullRequestChecksStatus {
|
||||
var summary PullRequestChecksStatus
|
||||
|
||||
if len(pr.StatusCheckRollup.Nodes) == 0 {
|
||||
return
|
||||
return summary
|
||||
}
|
||||
|
||||
commit := pr.StatusCheckRollup.Nodes[0].Commit
|
||||
|
|
@ -295,7 +297,7 @@ func (pr *PullRequest) ChecksStatus() (summary PullRequestChecksStatus) {
|
|||
summary.Total++
|
||||
}
|
||||
|
||||
return
|
||||
return summary
|
||||
}
|
||||
|
||||
func (pr *PullRequest) DisplayableReviews() PullRequestReviews {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue