aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Mengué <olivier.mengue@gmail.com>2026-03-16 10:15:53 +0100
committerGopher Robot <gobot@golang.org>2026-04-02 08:12:31 -0700
commit7bbb5a8ec139cce0d126d00de16b167c2512ca1b (patch)
tree354dc22a1eb7a0be3fd2ac81ed937402ea0218b3
parentaffadc7997466dfacad5b9a3dc90ee5e7a7b6085 (diff)
downloadgo-7bbb5a8ec139cce0d126d00de16b167c2512ca1b.tar.xz
io/fs: fix godoc to refer to the 'fsys' arg
Fix godoc for package io/fs functions where 'fs' is mentioned instead of the 'fsys' argument. This allows to more clearly distinguish references to the methods of that argument from functions of the io/fs package. Change-Id: I18674940e59dcf4501f46ee48f94fc58948df28c Reviewed-on: https://go-review.googlesource.com/c/go/+/755480 Auto-Submit: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Alan Donovan <adonovan@google.com> Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Damien Neil <dneil@google.com>
-rw-r--r--src/io/fs/glob.go2
-rw-r--r--src/io/fs/readdir.go6
-rw-r--r--src/io/fs/readfile.go6
-rw-r--r--src/io/fs/stat.go2
-rw-r--r--src/io/fs/sub.go2
5 files changed, 9 insertions, 9 deletions
diff --git a/src/io/fs/glob.go b/src/io/fs/glob.go
index db17156baf..ceb58859e6 100644
--- a/src/io/fs/glob.go
+++ b/src/io/fs/glob.go
@@ -27,7 +27,7 @@ type GlobFS interface {
// The only possible returned error is [path.ErrBadPattern], reporting that
// the pattern is malformed.
//
-// If fs implements [GlobFS], Glob calls fs.Glob.
+// If fsys implements [GlobFS], Glob calls fsys.Glob.
// Otherwise, Glob uses [ReadDir] to traverse the directory tree
// and look for matches for the pattern.
func Glob(fsys FS, pattern string) (matches []string, err error) {
diff --git a/src/io/fs/readdir.go b/src/io/fs/readdir.go
index 467d3bffee..bf3738f50b 100644
--- a/src/io/fs/readdir.go
+++ b/src/io/fs/readdir.go
@@ -23,9 +23,9 @@ type ReadDirFS interface {
// ReadDir reads the named directory
// and returns a list of directory entries sorted by filename.
//
-// If fs implements [ReadDirFS], ReadDir calls fs.ReadDir.
-// Otherwise ReadDir calls fs.Open and uses ReadDir and Close
-// on the returned file.
+// If fsys implements [ReadDirFS], ReadDir calls fsys.ReadDir.
+// Otherwise ReadDir calls fsys.Open and uses ReadDir and Close
+// on the returned [ReadDirFile].
func ReadDir(fsys FS, name string) ([]DirEntry, error) {
if fsys, ok := fsys.(ReadDirFS); ok {
return fsys.ReadDir(name)
diff --git a/src/io/fs/readfile.go b/src/io/fs/readfile.go
index 41ca5bfcf6..00e3144525 100644
--- a/src/io/fs/readfile.go
+++ b/src/io/fs/readfile.go
@@ -21,13 +21,13 @@ type ReadFileFS interface {
ReadFile(name string) ([]byte, error)
}
-// ReadFile reads the named file from the file system fs and returns its contents.
+// ReadFile reads the named file from the file system fsys and returns its contents.
// A successful call returns a nil error, not [io.EOF].
// (Because ReadFile reads the whole file, the expected EOF
// from the final Read is not treated as an error to be reported.)
//
-// If fs implements [ReadFileFS], ReadFile calls fs.ReadFile.
-// Otherwise ReadFile calls fs.Open and uses Read and Close
+// If fsys implements [ReadFileFS], ReadFile calls fsys.ReadFile.
+// Otherwise ReadFile calls fsys.Open and uses Read and Close
// on the returned [File].
func ReadFile(fsys FS, name string) ([]byte, error) {
if fsys, ok := fsys.(ReadFileFS); ok {
diff --git a/src/io/fs/stat.go b/src/io/fs/stat.go
index bbb91c2eae..2c22f477bc 100644
--- a/src/io/fs/stat.go
+++ b/src/io/fs/stat.go
@@ -15,7 +15,7 @@ type StatFS interface {
// Stat returns a [FileInfo] describing the named file from the file system.
//
-// If fs implements [StatFS], Stat calls fs.Stat.
+// If fsys implements [StatFS], Stat calls fsys.Stat.
// Otherwise, Stat opens the [File] to stat it.
func Stat(fsys FS, name string) (FileInfo, error) {
if fsys, ok := fsys.(StatFS); ok {
diff --git a/src/io/fs/sub.go b/src/io/fs/sub.go
index 63c7a3cf77..b591eb0cd5 100644
--- a/src/io/fs/sub.go
+++ b/src/io/fs/sub.go
@@ -20,7 +20,7 @@ type SubFS interface {
// Sub returns an [FS] corresponding to the subtree rooted at fsys's dir.
//
// If dir is ".", Sub returns fsys unchanged.
-// Otherwise, if fs implements [SubFS], Sub returns fsys.Sub(dir).
+// Otherwise, if fsys implements [SubFS], Sub returns fsys.Sub(dir).
// Otherwise, Sub returns a new [FS] implementation sub that,
// in effect, implements sub.Open(name) as fsys.Open(path.Join(dir, name)).
// The implementation also translates calls to ReadDir, ReadFile,