utils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTempFile added in v1.2.0

func CreateTempFile(tempDir string, nameTemplate string) (string, error)

CreateTempFile will create a temporary file using the nameTemplate. If `tempDir` is the empty string, `os.TempDir()` will be used as the target directory. Returns the name of the created file, and error is not nil if some problem happened

func CreateTempFileWithContent

func CreateTempFileWithContent(tempDir string, content string, nameTemplate string) (string, error)

CreateTempFileWithContent will create a temporary file with the content passed, and using the nameTemplate. If `tempDir` is the empty string, `os.TempDir()` will be used as the target directory. Returns the name of the created file, and error is not nil if some problem happened

func IsEmpty

func IsEmpty(data interface{}) bool

IsEmpty helper that returns true when a type is empty

func IsNotEmpty

func IsNotEmpty(data interface{}) bool

IsNotEmpty helper that returns true when a type is not empty

func MatchSlice added in v1.0.3

func MatchSlice(regex *regexp.Regexp, hayStack []string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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