1
0
mirror of https://github.com/golang/go synced 2024-11-26 18:06:55 -07:00

io/fs: minor corrections to Sub docs

Fixes #44376

Change-Id: I9cd21adb9d4d434c3d8b8eb8af3042b70c763ea1
Reviewed-on: https://go-review.googlesource.com/c/go/+/296389
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Ian Lance Taylor 2021-02-25 08:21:52 -08:00
parent e11d14225c
commit 4f572d7076

View File

@ -19,10 +19,10 @@ type SubFS interface {
// Sub returns an FS corresponding to the subtree rooted at fsys's dir. // Sub returns an FS corresponding to the subtree rooted at fsys's dir.
// //
// If fs implements SubFS, Sub calls returns fsys.Sub(dir). // If dir is ".", Sub returns fsys unchanged.
// Otherwise, if dir is ".", Sub returns fsys unchanged. // Otherwise, if fs implements SubFS, Sub returns fsys.Sub(dir).
// Otherwise, Sub returns a new FS implementation sub that, // Otherwise, Sub returns a new FS implementation sub that,
// in effect, implements sub.Open(dir) as fsys.Open(path.Join(dir, name)). // in effect, implements sub.Open(name) as fsys.Open(path.Join(dir, name)).
// The implementation also translates calls to ReadDir, ReadFile, and Glob appropriately. // The implementation also translates calls to ReadDir, ReadFile, and Glob appropriately.
// //
// Note that Sub(os.DirFS("/"), "prefix") is equivalent to os.DirFS("/prefix") // Note that Sub(os.DirFS("/"), "prefix") is equivalent to os.DirFS("/prefix")