Documentation
¶
Index ¶
- func BytesByteAt(s string, index int) byte
- func BytesIndexByteOrLen(s []byte, c byte) int
- func BytesToStrings(b [][]byte) []string
- func CleanUpRegexp(pattern string) string
- func Clip(n, start, last int) int
- func Clip32(n, start, last int32) int32
- func Clip64(n, start, last int64) int64
- func DoAndEnsure(fun func(), ensure func())
- func FirstNonEmpty(vals ...string) string
- func GoMulti(n int, f func()) func()
- func HomeExpanded(path string) string
- func IndexByteOrLen(s string, c byte) int
- func Iter[T any](array []T) func() *T
- func LessToCmp[E cmp.Ordered](less func(E, E) bool) func(E, E) int
- func MustExec(args []string)
- func MustParseFloat32(val string) float32
- func MustParseFloat64(val string) float64
- func MustParseInt(val string, base int) int
- func MustParseInt32(val string, base int) int32
- func MustParseInt64(val string, base int) int64
- func ParseFloat32(val string, defaultValue float32) float32
- func ParseFloat64(val string, defaultValue float64) float64
- func ParseInt(val string, base int, defaultValue int) int
- func ParseInt32(val string, base int, defaultValue int32) int32
- func ParseInt64(val string, base int, defaultValue int64) int64
- func ReadPdfAsText(file string, keepLayout bool) ([]byte, error)
- func SortedMap[K cmp.Ordered, V any](m map[K]V) iter.Seq2[K, V]
- func SortedMapFunc[K cmp.Ordered, V any](m map[K]V, compare func(K, K) int) iter.Seq2[K, V]
- func StringByteAt(s string, index int) byte
- func StringSlice(arr ...string) []string
- func StringsToBytes(s []string) [][]byte
- func Wrap(n, len int) int
- func Wrap32(n, len int32) int32
- func Wrap64(n, len int64) int64
- type Clock
- type InjectedClock
- type Iterator
- type LazyRegexp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesByteAt ¶
func BytesIndexByteOrLen ¶
func BytesToStrings ¶
func CleanUpRegexp ¶
Remove whitespace and comments from a regex pattern.
func DoAndEnsure ¶
func DoAndEnsure(fun func(), ensure func())
func FirstNonEmpty ¶
func HomeExpanded ¶
func IndexByteOrLen ¶
func Iter ¶
func Iter[T any](array []T) func() *T
Iter returns a function that returns elements in a given array, or return nil at the end.
func MustParseFloat32 ¶
func MustParseFloat64 ¶
func MustParseInt ¶
func MustParseInt32 ¶
func MustParseInt64 ¶
func ParseFloat32 ¶
func ParseFloat64 ¶
func ReadPdfAsText ¶
ReadPdfAsText reads a given PDF file as text.
func SortedMapFunc ¶
func StringByteAt ¶
func StringSlice ¶
StringSlice is a convenient way to build a string slice.
func StringsToBytes ¶
Types ¶
type Clock ¶
Clock is a mockable clock interface.
func NewInjectedClock ¶
NewInjectedClock creates a new mock clock.
type InjectedClock ¶
type InjectedClock struct {
// contains filtered or unexported fields
}
InjectedClock is a mock clock.
func (InjectedClock) Now ¶
func (c InjectedClock) Now() time.Time
type Iterator ¶
type Iterator[T any] struct { // contains filtered or unexported fields }
Iterator is a versatile iterator.
func NewIterable ¶
NewIterable creates a new Iterable, with an optional cleaner, which is called at the end.
type LazyRegexp ¶
type LazyRegexp struct {
// contains filtered or unexported fields
}
LazyRegexp is a sharable lazily compiled regexp.
func NewLazyRegexp ¶
func NewLazyRegexp(pattern string) LazyRegexp
NewLazyRegexp returns a sharable lazily compiled regexp.
func (*LazyRegexp) Pattern ¶
func (l *LazyRegexp) Pattern() *regexp.Regexp
Pattern returns a shared regexp.
Click to show internal directories.
Click to hide internal directories.