Skip to content

Commit

Permalink
io/fs: clarify additional File interface docs
Browse files Browse the repository at this point in the history
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 <[email protected]>
Run-TryBot: Josh Bleecher Snyder <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
josharian committed Mar 11, 2021
1 parent 0a65559 commit bbf7979
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/io/fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bbf7979

Please sign in to comment.