package
0.0.0-20231126024412-02539191b02e
Repository: https://github.com/mjpitz/myago.git
Documentation: pkg.go.dev
# README
vfs
Package vfs provides utilities for managing virtual file systems on contexts to
avoid direct calls to the built-in os
interface. This is particularly useful
for testing. Currently, this wraps the afero virtual file system which provides
OS and in memory implementations.
import go.pitz.tech/lib/vfs
Usage
func ToContext
func ToContext(ctx context.Context, fs FS) context.Context
ToContext sets the file system on the provided context.
type FS
type FS = afero.Fs
FS provides a file system abstraction.
func Extract
func Extract(ctx context.Context) FS
Extract pulls the file system from the provided context. If no file system is found, then the defaultFS is returned.
# Type aliases
FS provides a file system abstraction.