utils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src, dst string) error

Copy files and directories from source to destination.

func IsDirOrCreate

func IsDirOrCreate(path string) error

IsDirOrCreate checks if the given path exists and is a directory. If the directory does not exist, it attempts to create it.

func IsDirOrError

func IsDirOrError(path string) error

IsDirOrError checks if the given path exists and is a directory.

func IsFileOrCreate

func IsFileOrCreate(path string) error

IsFileOrCreate checks if the given path exists and is a file. If the file does not exist, it attempts to create it.

func IsFileOrError

func IsFileOrError(path string) error

IsFileOrError checks if the given path exists and is a file.

func ReadFile

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

ReadFile reads the content of a file specified by the path.

func WriteToFile

func WriteToFile(path string, data []byte) error

WriteToFile writes the given data to a file at the specified path. If the file does not exist, it is created.

Types

This section is empty.

Jump to

Keyboard shortcuts

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