Skip to content

Commit

Permalink
path/filepath: add explicit comment marking elided errors
Browse files Browse the repository at this point in the history
The errors on these lines are meant to be discarded.
Add a comment to make that extra clear.

Change-Id: I38f72af6dfbb0e86677087baf47780b3cc6e7d40
Reviewed-on: https://go-review.googlesource.com/c/go/+/241083
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
rsc committed Jul 7, 2020
1 parent 6a167c7 commit 6b34417
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/path/filepath/match.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,14 +310,14 @@ func glob(dir, pattern string, matches []string) (m []string, e error) {
m = matches
fi, err := os.Stat(dir)
if err != nil {
return
return // ignore I/O error
}
if !fi.IsDir() {
return
return // ignore I/O error
}
d, err := os.Open(dir)
if err != nil {
return
return // ignore I/O error
}
defer d.Close()

Expand Down

0 comments on commit 6b34417

Please sign in to comment.