helpers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 added in v0.1.1

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 added in v0.2.0

func IsString(i any) bool

IsString reports whether i is a string.

func JoinWithConjunction added in v0.16.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