fmtdirent_go121.go

 1//go:build go1.21
 2
 3package fmtdirent
 4
 5import "io/fs"
 6
 7// FormatDirEntry returns a formatted version of dir for human readability.
 8// Implementations of [DirEntry] can call this from a String method.
 9// The outputs for a directory named subdir and a file named hello.go are:
10//
11//	d subdir/
12//	- hello.go
13func FormatDirEntry(dir fs.DirEntry) string {
14	return fs.FormatDirEntry(dir)
15}