Help us shape the future of Go! Take the 2026 Go Developer Survey

utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstantTimeMask

func ConstantTimeMask(x, y []byte) int

ConstantTimeMask returns 1 if logical AND of two slices is non zero and 0 otherwise. The time taken is a function of the length of the slices and is independent of the contents. If the lengths of x and y do not match it returns 0 immediately.

func WithTimeout

func WithTimeout(
	ctx context.Context,
	timeout time.Duration,
	do func(context.Context) error,
) error

func WrapError

func WrapError[T any](wrap error, do func() (T, error)) (T, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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