fsys

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2026 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultFS = LocalFS

DefaultFS returns a new fs.FS for accessing the local filesystem.

Functions

func Equal

func Equal(a, b fs.FS) bool

func LocalFS

func LocalFS() (fs.FS, error)

LocalFS returns a new fs.FS that relays `Open()` calls to os.Open. Unlike os.DirFS, this proxy can return a wrapped os.ErrNotExist.

func NewFSFunc

func NewFSFunc[F fs.File](fn func(string) (F, error)) fs.FS

NewFSFunc turns a function that returns a type compatible with fs.File into an fs.FS.

Types

type WrapFS

type WrapFS struct {
	FS      fs.FS
	BaseDir string
}

func (WrapFS) Equal

func (w WrapFS) Equal(other any) bool

Equal returns true if the types are the same, the BaseDirs are the same, and the FS fields are equal under FSEqual.

func (WrapFS) Format

func (w WrapFS) Format(state fmt.State, verb rune)

func (WrapFS) Open

func (w WrapFS) Open(fpath string) (fs.File, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL