diff options
| author | Ian Lance Taylor <iant@golang.org> | 2023-05-01 17:38:08 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-05-04 16:27:35 +0000 |
| commit | 1596aeec8ecc8f115bffad49a3d92944fc278f9a (patch) | |
| tree | 3bb90b11f06add9b467d206abb8263e8dfe73d2c /src/testing | |
| parent | 09a24a91b5aff200aa5fb8e75977c5a354702089 (diff) | |
| download | go-1596aeec8ecc8f115bffad49a3d92944fc278f9a.tar.xz | |
all: add String for fs.{FileInfo,DirEntry} implementations
The new String methods use the new FormatFileInfo and
FormatDirEntry functions.
Fixes #54451
Change-Id: I414cdfc212ec3c316fb2734756d2117842a23631
Reviewed-on: https://go-review.googlesource.com/c/go/+/491175
Reviewed-by: Joseph Tsai <joetsai@digital-static.net>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/testing')
| -rw-r--r-- | src/testing/fstest/mapfs.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/testing/fstest/mapfs.go b/src/testing/fstest/mapfs.go index 4595b7313d..a0b1f65668 100644 --- a/src/testing/fstest/mapfs.go +++ b/src/testing/fstest/mapfs.go @@ -159,6 +159,10 @@ func (i *mapFileInfo) IsDir() bool { return i.f.Mode&fs.ModeDir ! func (i *mapFileInfo) Sys() any { return i.f.Sys } func (i *mapFileInfo) Info() (fs.FileInfo, error) { return i, nil } +func (i *mapFileInfo) String() string { + return fs.FormatFileInfo(i) +} + // An openMapFile is a regular (non-directory) fs.File open for reading. type openMapFile struct { path string |
