fileutil

package
v1.0.52 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanSpecial added in v1.0.26

func CleanSpecial(path string) string

func DirExists added in v1.0.37

func DirExists(dir string) (bool, error)

func FileExists added in v1.0.37

func FileExists(file string) (bool, error)

func IsDir added in v1.0.37

func IsDir(file string) (bool, error)

func IsFile added in v1.0.37

func IsFile(file string) (bool, error)

func Patch

func Patch(file string, patch func(data []byte) ([]byte, error)) error

func PatchJSON

func PatchJSON[T any](file string, patch func(v *T) error) error

func PatchJSONPretty

func PatchJSONPretty[T any](file string, patch func(v *T) error) error

func ReadFile added in v1.0.45

func ReadFile(file string) ([]byte, error)

func Slashlize added in v1.0.51

func Slashlize(path string) string

func WalkRelative added in v1.0.37

func WalkRelative(root string, h func(path string, relPath string, d fs.DirEntry) error) error

WalkRelative: calculate relative path when walking

func WriteFile added in v1.0.45

func WriteFile(file string, data []byte) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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