Skip to content

Commit

Permalink
os: document DirFS implements fs.StatFS
Browse files Browse the repository at this point in the history
Fixes #51856

Change-Id: I8328d73bbb7bc166d58281180b64785a634e9bab
Reviewed-on: https://go-review.googlesource.com/c/go/+/394555
Reviewed-by: Ian Lance Taylor <[email protected]>
Trust: Daniel Martí <[email protected]>
Run-TryBot: Daniel Martí <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
hopehook authored and ianlancetaylor committed Mar 26, 2022
1 parent 3f69cc7 commit b0750de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/os/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@ func isWindowsNulName(name string) bool {
// the /prefix tree, then using DirFS does not stop the access any more than using
// os.Open does. DirFS is therefore not a general substitute for a chroot-style security
// mechanism when the directory tree contains arbitrary content.
//
// The result implements fs.StatFS.
func DirFS(dir string) fs.FS {
return dirFS(dir)
}
Expand Down

0 comments on commit b0750de

Please sign in to comment.