aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-02-25 08:21:52 -0800
committerIan Lance Taylor <iant@golang.org>2021-06-02 18:52:58 +0000
commit4f572d707661e3e84ff262d6c605eb6fa1f77abd (patch)
tree2f4a7d87231a8dd9133f58da94088a99dfa0abcf
parente11d14225c032a7c2722798db3c309762fa99757 (diff)
downloadgo-4f572d707661e3e84ff262d6c605eb6fa1f77abd.tar.gz
go-4f572d707661e3e84ff262d6c605eb6fa1f77abd.zip
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>
-rw-r--r--src/io/fs/sub.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/io/fs/sub.go b/src/io/fs/sub.go
index 7822e555ea..ae20e030a9 100644
--- a/src/io/fs/sub.go
+++ b/src/io/fs/sub.go
@@ -19,10 +19,10 @@ type SubFS interface {
// Sub returns an FS corresponding to the subtree rooted at fsys's dir.
//
-// If fs implements SubFS, Sub calls returns fsys.Sub(dir).
-// Otherwise, if dir is ".", Sub returns fsys unchanged.
+// 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,
-// 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.
//
// Note that Sub(os.DirFS("/"), "prefix") is equivalent to os.DirFS("/prefix")