util

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtLeastOneMatch

func AtLeastOneMatch(patterns []*regexp.Regexp, value string) bool

AtLeastOneMatch returns whether the given value matches at least one of the given Regex patterns.

func BulkCompile

func BulkCompile(patternsRaw []string) ([]*regexp.Regexp, error)

BulkCompile compiles the given patterns in bulk and returned the result.

func CopyFile added in v0.6.0

func CopyFile(fromPath string, toPath string) error

CopyFile copies the given file from the given path to the other given path.

func IterFilterErr added in v0.5.0

func IterFilterErr[T any](items iter.Seq[T], filter func(T) (bool, error)) iter.Seq2[T, error]

IterFilterErr returns an iterator with values filtered using the given filter func.

func IterFirst added in v0.5.0

func IterFirst[T any](items iter.Seq[T]) (T, iter.Seq[T])

IterFirst returns the first value of an iterator and a pull-style iterator over the rest of the iterator.

func IterMap added in v0.5.0

func IterMap[I, O any](items iter.Seq[I], transform func(I) O) iter.Seq[O]

IterMap transforms the given sequence of values with the given function and returns a sequence of the values transformed with the given transform function.

func PathIsEmpty added in v0.6.0

func PathIsEmpty(path string) (bool, error)

PathIsEmpty returns whether the given path is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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