helpers

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: Apache-2.0 Imports: 7 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, dst string) error

CopyDirectoryContent replaces dst with the contents of src, removing dst first if it exists and creating it fresh. Returns an error if src does not exist or if src is not a directory.

func CopyFile

func CopyFile(src, dst string) (retErr 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 IsString

func IsString(i any) bool

IsString reports whether i is a string.

func JoinWithConjunction added in v0.14.0

func JoinWithConjunction(items []string, conjunction string) (string, error)

JoinWithConjunction joins a slice of strings into a human-readable list, separating items with commas and prefixing the last item with conjunction (e.g., "and" or "or"). Returns an empty string for an empty slice, the single value for a one-element slice, and two values joined by the conjunction without commas. Returns an error if conjunction is blank.

Types

This section is empty.

Jump to

Keyboard shortcuts

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