fsutil

package
v0.82.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package fsutil provides utility functions for working with the filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src, dst string) error

CopyDir recursively copies a directory from src to dst.

func CopyFile

func CopyFile(src, dest string) error

CopyFile copies a single file from src to dest

func CopyFiles

func CopyFiles(srcDestTuples ...[2]string) error

CopyFiles takes any number of src-dest tuples and copies each file from src to dest.

func EnsureDir

func EnsureDir(path string) error

EnsureDir creates a directory if it does not exist.

func EnsureDirs

func EnsureDirs(paths ...string) error

func FromGob

func FromGob[T any](file fs.File) (T, error)

FromGob decodes a gob-encoded file into a value of type T.

func FromGobInto

func FromGobInto(file fs.File, destPtr any) error

FromGobInto decodes a gob-encoded file into a destination. The destination must be a pointer to the destination type.

func GetCallerDir

func GetCallerDir() string

GetCallerDir returns the directory of the calling function.

func MustReadFile

func MustReadFile(f fs.FS, name string) []byte

func MustSub

func MustSub(f fs.FS, dirElems ...string) fs.FS

Types

This section is empty.

Jump to

Keyboard shortcuts

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