aboutsummaryrefslogtreecommitdiff
path: root/src/embed
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-05-01 17:38:08 -0700
committerGopher Robot <gobot@golang.org>2023-05-04 16:27:35 +0000
commit1596aeec8ecc8f115bffad49a3d92944fc278f9a (patch)
tree3bb90b11f06add9b467d206abb8263e8dfe73d2c /src/embed
parent09a24a91b5aff200aa5fb8e75977c5a354702089 (diff)
downloadgo-1596aeec8ecc8f115bffad49a3d92944fc278f9a.tar.gz
go-1596aeec8ecc8f115bffad49a3d92944fc278f9a.zip
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/embed')
-rw-r--r--src/embed/embed.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/embed/embed.go b/src/embed/embed.go
index 66934a8974..8d155ebd55 100644
--- a/src/embed/embed.go
+++ b/src/embed/embed.go
@@ -243,6 +243,10 @@ func (f *file) Mode() fs.FileMode {
return 0444
}
+func (f *file) String() string {
+ return fs.FormatFileInfo(f)
+}
+
// dotFile is a file for the root directory,
// which is omitted from the files list in a FS.
var dotFile = &file{name: "./"}