diff options
author | Josh Bleecher Snyder <josharian@gmail.com> | 2021-02-25 09:32:38 -0800 |
---|---|---|
committer | Josh Bleecher Snyder <josharian@gmail.com> | 2021-03-11 18:25:30 +0000 |
commit | bbf79793bdeda04d520377406024d7bb66aa62dc (patch) | |
tree | 63b028a95c29f1cf7857a63163aafcd073e3cbb1 | |
parent | 0a655598e150ee8ddd96573744c4b60735658f32 (diff) | |
download | go-bbf79793bdeda04d520377406024d7bb66aa62dc.tar.gz go-bbf79793bdeda04d520377406024d7bb66aa62dc.zip |
io/fs: clarify additional File interface docs
Emphasize ReadDirFile. It isn't really optional,
and all filesystems have at least one directory (".").
The remaining two additional interfaces are optimizations.
Call them that.
Fully qualify package package io identifiers.
Change-Id: Ibc425a5dfd27e08c2c10c353f780e4a6304cfd87
Reviewed-on: https://go-review.googlesource.com/c/go/+/296390
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r-- | src/io/fs/fs.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/io/fs/fs.go b/src/io/fs/fs.go index 3d2e2ee2ac..e1be32478e 100644 --- a/src/io/fs/fs.go +++ b/src/io/fs/fs.go @@ -73,8 +73,8 @@ func ValidPath(name string) bool { // A File provides access to a single file. // The File interface is the minimum implementation required of the file. -// A file may implement additional interfaces, such as -// ReadDirFile, ReaderAt, or Seeker, to provide additional or optimized functionality. +// Directory files should also implement ReadDirFile. +// A file may implement io.ReaderAt or io.Seeker as optimizations. type File interface { Stat() (FileInfo, error) Read([]byte) (int, error) |