Skip to content

Commit

Permalink
Add osfs.New
Browse files Browse the repository at this point in the history
  • Loading branch information
mojatter committed Nov 9, 2021
1 parent 4a7985f commit 11b0da0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion osfs/osfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
// DirFS returns a filesystem for the tree of files rooted at the directory dir.
// The filesystem can write using io2.WriteFile(fsys fs.FS, name string, p []byte).
func DirFS(dir string) fs.FS {
return NewOSFS(dir)
return New(dir)
}

// containsDenyWin reports whether any path characters of windows are within s.
Expand Down Expand Up @@ -61,7 +61,13 @@ var (
)

// NewOSFS returns a filesystem for the tree of files rooted at the directory dir.
// Deprecated: Use New.
func NewOSFS(dir string) *OSFS {
return New(dir)
}

// New returns a filesystem for the tree of files rooted at the directory dir.
func New(dir string) *OSFS {
return &OSFS{
Dir: dir,
osFS: io2.DelegateFS(os.DirFS(dir)),
Expand Down

0 comments on commit 11b0da0

Please sign in to comment.