Documentation ¶
Overview ¶
Package util provides various utility functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Remember ¶
type Remember[T any] interface { // Get returns nil if nothing is remembered or it has expired Get() *T // Update sets the thing to be remembered Update(*T) // Forget clears the thing that was remembered Forget() }
Remember stores an item for a period of time. It is safe to share with multiple goroutines.
type TestSequence ¶
type TestSequence interface { // Run runs the test function f as a subtest of t called name. It returns whether the test succeeded or failed. Run(name string, f func(t *testing.T)) bool }
TestSequence is a wrapper around *testing.T that ensures that tests are run in sequence. If a test fails, all subsequent tests are skipped.
func NewTestSequence ¶
func NewTestSequence(t *testing.T) TestSequence
NewTestSequence creates a new test sequence.
type UnboundedChan ¶
type UnboundedChan[T any] interface { In() chan<- T Out() <-chan T Close() }
UnboundedChan is a channel with an unbounded buffer
func NewUnboundedChan ¶
func NewUnboundedChan[T any](interval time.Duration) UnboundedChan[T]
NewUnboundedChan creates a new unbounded channel
Click to show internal directories.
Click to hide internal directories.