зеркало из https://github.com/golang/build.git
maintner/maintnerd/maintapi: assign, not append, to empty slice
Assign the first element to an empty slice, rather than appending it. There is no behavior change. The goal of this CL is to improve code readability only. After this change, it should be easier for the reader to see what the slice content will be, without having to verify that earlier code has not assigned anything to that slice. Change-Id: I2aaeaafafbdf206f57b0f85b42ccfa726e72ca8c Reviewed-on: https://go-review.googlesource.com/c/155461 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Родитель
07f3a29356
Коммит
b67de002b3
|
@ -189,9 +189,9 @@ func (s apiService) GoFindTryWork(ctx context.Context, req *apipb.GoFindTryWorkR
|
|||
work.Commit = ci.CurrentRevision
|
||||
}
|
||||
if work.Project != "go" {
|
||||
// Trybot on a subrepo. Append master and the supported releases.
|
||||
work.GoBranch = append(work.GoBranch, "master")
|
||||
work.GoCommit = append(work.GoCommit, goProj.Ref("refs/heads/master").String())
|
||||
// Trybot on a subrepo. Set the Go fields to master and the supported releases.
|
||||
work.GoBranch = []string{"master"}
|
||||
work.GoCommit = []string{goProj.Ref("refs/heads/master").String()}
|
||||
for _, r := range supportedReleases {
|
||||
work.GoBranch = append(work.GoBranch, r.BranchName)
|
||||
work.GoCommit = append(work.GoCommit, r.BranchCommit)
|
||||
|
|
Загрузка…
Ссылка в новой задаче