util

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v0.9.0

func Close(err error, closer io.Closer) error

func CreateIfNotExists added in v0.11.0

func CreateIfNotExists(dir string) error

CreateIfNotExists --.

func CreateInWorkingDir added in v0.11.0

func CreateInWorkingDir(dir string) (string, error)

CreateInWorkingDir --.

func GetInWorkingDir added in v0.11.0

func GetInWorkingDir(dir string) (string, error)

GetInWorkingDir --.

func ReadFile added in v0.11.0

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

ReadFile a safe wrapper of os.ReadFile.

func RemoveFromWorkingDir added in v0.11.0

func RemoveFromWorkingDir(dir string) error

RemoveFromWorkingDir --.

func StringSliceContains

func StringSliceContains(slice []string, items []string) bool

StringSliceContains --.

func StringSliceExists

func StringSliceExists(slice []string, item string) bool

StringSliceExists --.

func StringSliceUniqueAdd

func StringSliceUniqueAdd(slice *[]string, item string) bool

StringSliceUniqueAdd append the given item if not already present in the slice.

func WithFile added in v0.9.0

func WithFile(name string, flag int, perm os.FileMode, consumer func(out io.Writer) error) error

WithFile a safe wrapper to process a file.

Types

This section is empty.

Directories

Path Synopsis
log

Jump to

Keyboard shortcuts

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