Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithSourceableError ¶
func WithSourceableError(ctx context.Context, source SourceableError) context.Context
WithSourceableError returns a new Context that carries the source. When the Err method is checked on the context, it will return the error from the source if the context was canceled or deadline exceeded.
Types ¶
type ContextKey ¶
type ContextKey string
ContextKey defines a type for selecting values within a given context.
type SourceableError ¶
type SourceableError interface {
Err() error
}
SourceableError is an interface that can be implemented by errors that can be used as the source of a context error.
Click to show internal directories.
Click to hide internal directories.