Skip to content

Commit 8055c5d

Browse files
committed
Go: Avoid extra loop to track unsuccessfulProjects
1 parent 020eb4a commit 8055c5d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

go/extractor/cli/go-autobuilder/go-autobuilder.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,9 @@ func installDependenciesAndBuild() {
603603
}
604604
}
605605

606+
// Track all projects which could not be extracted successfully
607+
var unsuccessfulProjects = []string{}
608+
606609
// Attempt to extract all workspaces; we will tolerate individual extraction failures here
607610
for i, workspace := range workspaces {
608611
goVersionInfo := workspace.RequiredGoVersion()
@@ -639,13 +642,8 @@ func installDependenciesAndBuild() {
639642
}
640643

641644
workspaces[i].Extracted = extract(workspace)
642-
}
643-
644-
// Find all projects which could not be extracted successfully
645-
var unsuccessfulProjects = []string{}
646645

647-
for _, workspace := range workspaces {
648-
if !workspace.Extracted {
646+
if !workspaces[i].Extracted {
649647
unsuccessfulProjects = append(unsuccessfulProjects, workspace.BaseDir)
650648
}
651649
}

0 commit comments

Comments
 (0)