helpers

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package helpers implements utility routines for working with the filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDirectoryContent

func CopyDirectoryContent(src string, dst string) error

CopyDirectoryContent copies the content of the src directory to the dst directory. Returns an error if src does not exist, or if src is not a directory.

func CopyFile

func CopyFile(src string, dst string) error

CopyFile copies a file from src to dst, overwriting an existing file if present. Returns an error if src does not exist, or if src is a directory.

func Exists

func Exists(path string) (bool, error)

Exists reports whether path exists.

func IsDir

func IsDir(path string) (bool, error)

IsDir reports whether path is a directory, returning an error if path does not exist.

func IsEmpty

func IsEmpty(path string) (bool, error)

IsEmpty reports if the given file or directory is empty, returning an error if path does not exist.

func IsFile

func IsFile(path string) (bool, error)

IsFile reports whether path is a regular file, returning an error if path does not exist.

func IsInt

func IsInt(i any) bool

IsInt reports whether i is an integer.

func IsString

func IsString(i any) bool

IsString reports whether i is a string.

func RemoveDirectoryContent

func RemoveDirectoryContent(dir string) error

RemoveDirectoryContent removes all content from dir, preserving the directory itself. Returns an error if dir does not exist, or if dir is not 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