Skip to content

Commit 4b154e5

Browse files
wjw1758548031gopherbot
authored andcommitted
cmd/dist: check for errors from filepath.Glob
Change-Id: Ib5bcd3d1e9618d65b4d4b0895d0e40dbd76646c6 GitHub-Last-Rev: 174084c GitHub-Pull-Request: #59516 Reviewed-on: https://go-review.googlesource.com/c/go/+/483435 Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent de475e8 commit 4b154e5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/cmd/dist/build.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,10 @@ func cmdbootstrap() {
14521452
bootstrapBuildTools()
14531453

14541454
// Remember old content of $GOROOT/bin for comparison below.
1455-
oldBinFiles, _ := filepath.Glob(pathf("%s/bin/*", goroot))
1455+
oldBinFiles, err := filepath.Glob(pathf("%s/bin/*", goroot))
1456+
if err != nil {
1457+
fatalf("glob: %v", err)
1458+
}
14561459

14571460
// For the main bootstrap, building for host os/arch.
14581461
oldgoos = goos
@@ -1592,7 +1595,11 @@ func cmdbootstrap() {
15921595

15931596
// Check that there are no new files in $GOROOT/bin other than
15941597
// go and gofmt and $GOOS_$GOARCH (target bin when cross-compiling).
1595-
binFiles, _ := filepath.Glob(pathf("%s/bin/*", goroot))
1598+
binFiles, err := filepath.Glob(pathf("%s/bin/*", goroot))
1599+
if err != nil {
1600+
fatalf("glob: %v", err)
1601+
}
1602+
15961603
ok := map[string]bool{}
15971604
for _, f := range oldBinFiles {
15981605
ok[f] = true

0 commit comments

Comments
 (0)