mt

package module
v0.0.0-...-91ba331 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All[T any, S ~[]T](arr S, fn func(T) bool) bool

func Comparable

func Comparable[T comparable](v T) T

func Distinct

func Distinct[T comparable, S ~[]T](arr S) S

func Done

func Done(ctx context.Context) bool

func Filter

func Filter[T any, S ~[]T](arr S, fn func(T) bool) S

func KeyValue

func KeyValue(e string) (key string, value string, found bool)

func KeyValueMulti

func KeyValueMulti(e string) (key string, value string, found bool)

func Map

func Map[S any, D any](arr []S, fn func(S) D) []D

func Must

func Must[T any](v T, err error) T

func Must0

func Must0[T1 any, T2 any](v1 T1, v2 T2, err error) (T1, T2)

func Or

func Or[T any, S ~[]T](arr S, fn func(T) bool) bool

func PtrValueOrDefault

func PtrValueOrDefault[T any](v *T) T

func Reduce

func Reduce[T any, S ~[]T](arr S, fn func(v1, v2 T) T) T

func Set

func Set[T comparable, S ~[]T](arr S) map[T]bool

func Sum

func Sum[T cmp.Ordered, S ~[]T](arr S) T

func Timeout

func Timeout(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)

Timeout Deprecated: use context.WithTimeout() is enough

func UnquoteString

func UnquoteString(s string) string

func Zero

func Zero[T any]() T

Types

This section is empty.

Directories

Path Synopsis
common
generic
Package generic To iterate over a list (where l is a *List):
Package generic To iterate over a list (where l is a *List):
closeme
Package closeme collects io.Closer and StopCloser resources behind a single Manager and tears them down on demand.
Package closeme collects io.Closer and StopCloser resources behind a single Manager and tears them down on demand.
container
Package container provides a hash-table-backed value store that can be attached to a context.Context.
Package container provides a hash-table-backed value store that can be attached to a context.Context.

Jump to

Keyboard shortcuts

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