copyfs

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

README

go-copyfs

go-copyfs is a library to copy a given fs.FS into the local filesystem.

Note: go-copyfs doesn't support the symlink because fs.FS doesn't support as of Go 1.18.

Motivation

When I was writing tests, I wanted to extract files in embed.FS into the local filesystem because the code only accept a filename in the local filesystem. I had to write some code to deal with the temporary directory and copy the files into it.

That's why I wrote this small library, go-copyfs.

Usage

See copyfs_test.go

License

See LICENSE

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFS

func CopyFS(destDir string, srcFS fs.FS) error

CopyFS copies contents in the srcFS fs.FS into the local filesystem at destDir. destDir must be a directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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