ctxwait

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 3 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

Overview

Package ctxwait waits for a duration or for the end of a context, whichever comes first. It is the one timer wait of the module: the packages that need a wait they can replace in a test keep a field of this function's type and default it to Sleep.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sleep

func Sleep(ctx context.Context, d time.Duration) error

Sleep blocks for d, or until ctx is done. It returns nil when d passed, and an error that wraps the cause of ctx otherwise. The timer is stopped on return.

Types

This section is empty.

Jump to

Keyboard shortcuts

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