diff options
| author | cui fliter <imcusg@gmail.com> | 2023-10-14 17:47:57 +0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-10-18 19:34:35 +0000 |
| commit | 345f6cd1bd51cc58e62b287c2b679477ed5a30e8 (patch) | |
| tree | f4e3c9dc9eb628aff51a3970a4c53ee0eea10843 /src/io/fs | |
| parent | 1340662ab4c56f946337518bda94f861478d2661 (diff) | |
| download | go-345f6cd1bd51cc58e62b287c2b679477ed5a30e8.tar.xz | |
io: add available godoc link
Change-Id: I5973a352edb73e02a274d939d6d0573788640dc9
Reviewed-on: https://go-review.googlesource.com/c/go/+/535435
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: shuang cui <imcusg@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Diffstat (limited to 'src/io/fs')
| -rw-r--r-- | src/io/fs/format.go | 2 | ||||
| -rw-r--r-- | src/io/fs/fs.go | 12 | ||||
| -rw-r--r-- | src/io/fs/walk.go | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/io/fs/format.go b/src/io/fs/format.go index 4da6682f3a..60b40df1e8 100644 --- a/src/io/fs/format.go +++ b/src/io/fs/format.go @@ -9,7 +9,7 @@ import ( ) // FormatFileInfo returns a formatted version of info for human readability. -// Implementations of FileInfo can call this from a String method. +// Implementations of [FileInfo] can call this from a String method. // The output for a file named "hello.go", 100 bytes, mode 0o644, created // January 1, 1970 at noon is // diff --git a/src/io/fs/fs.go b/src/io/fs/fs.go index 09a9dad258..d6c75c4cf4 100644 --- a/src/io/fs/fs.go +++ b/src/io/fs/fs.go @@ -17,7 +17,7 @@ import ( // // The FS interface is the minimum implementation required of the file system. // A file system may implement additional interfaces, -// such as ReadFileFS, to provide additional or optimized functionality. +// such as [ReadFileFS], to provide additional or optimized functionality. type FS interface { // Open opens the named file. // @@ -82,7 +82,7 @@ type File interface { } // A DirEntry is an entry read from a directory -// (using the ReadDir function or a [ReadDirFile]'s ReadDir method). +// (using the [ReadDir] function or a [ReadDirFile]'s ReadDir method). type DirEntry interface { // Name returns the name of the file (or subdirectory) described by the entry. // This name is only the final element of the path (the base name), not the entire path. @@ -147,7 +147,7 @@ func errExist() error { return oserror.ErrExist } func errNotExist() error { return oserror.ErrNotExist } func errClosed() error { return oserror.ErrClosed } -// A FileInfo describes a file and is returned by Stat. +// A FileInfo describes a file and is returned by [Stat]. type FileInfo interface { Name() string // base name of the file Size() int64 // length in bytes for regular files; system-dependent for others @@ -219,7 +219,7 @@ func (m FileMode) String() string { } // IsDir reports whether m describes a directory. -// That is, it tests for the ModeDir bit being set in m. +// That is, it tests for the [ModeDir] bit being set in m. func (m FileMode) IsDir() bool { return m&ModeDir != 0 } @@ -230,12 +230,12 @@ func (m FileMode) IsRegular() bool { return m&ModeType == 0 } -// Perm returns the Unix permission bits in m (m & ModePerm). +// Perm returns the Unix permission bits in m (m & [ModePerm]). func (m FileMode) Perm() FileMode { return m & ModePerm } -// Type returns type bits in m (m & ModeType). +// Type returns type bits in m (m & [ModeType]). func (m FileMode) Type() FileMode { return m & ModeType } diff --git a/src/io/fs/walk.go b/src/io/fs/walk.go index 06228385d7..48145d4cfc 100644 --- a/src/io/fs/walk.go +++ b/src/io/fs/walk.go @@ -46,7 +46,7 @@ var SkipAll = errors.New("skip everything and stop the walk") // // First, if the initial [Stat] on the root directory fails, WalkDir // calls the function with path set to root, d set to nil, and err set to -// the error from fs.Stat. +// the error from [fs.Stat]. // // Second, if a directory's ReadDir method (see [ReadDirFile]) fails, WalkDir calls the // function with path set to the directory's path, d set to an @@ -106,7 +106,7 @@ func walkDir(fsys FS, name string, d DirEntry, walkDirFn WalkDirFunc) error { // directory in the tree, including root. // // All errors that arise visiting files and directories are filtered by fn: -// see the fs.WalkDirFunc documentation for details. +// see the [fs.WalkDirFunc] documentation for details. // // The files are walked in lexical order, which makes the output deterministic // but requires WalkDir to read an entire directory into memory before proceeding |
