util

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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