util

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MEGABYTE = 1024 * 1024

Variables

This section is empty.

Functions

func AddStackTrace added in v0.0.10

func AddStackTrace(e error) error

func Chunks added in v0.0.29

func Chunks[T any](xs []T, chunkSize int) [][]T

func EnableErrorStackTrace added in v0.0.10

func EnableErrorStackTrace()

func Filter added in v0.0.10

func Filter[T any](slice []T, f func(T) bool) []T

func GetStackTrace added in v0.0.10

func GetStackTrace(e error) string

func PrintStackTrace added in v0.0.10

func PrintStackTrace(e error, w io.Writer)

func SendAllFromSlice added in v0.0.10

func SendAllFromSlice[T any](ctx context.Context, out chan<- T, items []T) error

SendAllFromSlice iterates over `items` and sends each one over `out` unless `ctx` is cancelled. Returns ctx.Err() if not all items were written to the channel.

func StartProfiler

func StartProfiler()

Types

This section is empty.

Directories

Path Synopsis
Backport of os/rlimit.go from go1.19.
Backport of os/rlimit.go from go1.19.

Jump to

Keyboard shortcuts

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