]> Cypherpunks repositories - gostls13.git/commitdiff
path/filepath: add explicit comment marking elided errors
authorRuss Cox <rsc@golang.org>
Mon, 6 Jul 2020 15:28:15 +0000 (11:28 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 7 Jul 2020 03:43:31 +0000 (03:43 +0000)
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 <iant@golang.org>
src/path/filepath/match.go

index 46badb5e840ba74b35a9f57dcfd4969f6cc23710..20a334805ba8a1c0e43233be578b2179a0cc2af8 100644 (file)
@@ -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()