fsext

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyAllEmbed

func CopyAllEmbed(efs embed.FS, destDir string) error

CopyAllEmbed copies everything from the root of the embedded FS to destDir.

func CopyFromEmbed

func CopyFromEmbed(fsx fs.FS, srcDir, destDir string) error

CopyFromEmbed recursively copies all files from an embed.FS directory to a destination.

func MustReadFromEmbed added in v0.0.8

func MustReadFromEmbed(fs embed.FS, name string) string

MustReadFromEmbed reads a file from an embedded filesystem and returns its contents as a string.

Panics if the file cannot be read.

func ReadFromEmbed added in v0.0.8

func ReadFromEmbed(fs embed.FS, name string) (string, error)

ReadFromEmbed reads a file from an embedded filesystem and returns its contents as a string.

Returns an error if the file cannot be read.

Types

type FS

type FS interface {
	afero.Fs
}

FS is a stub for afero.Fs for testing.

Jump to

Keyboard shortcuts

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