Documentation
¶
Overview ¶
Package errbuf allows to bufferize errors before processing them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedError ¶
BufferedError wrapper around errors slice with mutex.
func NewFromError ¶ added in v1.2.0
func NewFromError(err error) *BufferedError
NewFromError creates new BufferedError from the given error.
func (*BufferedError) Add ¶
func (b *BufferedError) Add(err error)
Add adds given error to the errors buffer. No-op if error is nil.
func (*BufferedError) Clear ¶ added in v1.2.0
func (b *BufferedError) Clear()
Clear clears internal slice of errors. Freed memory will be collected by GC.
func (*BufferedError) Err ¶
func (b *BufferedError) Err() error
Err returns nil if error buffer is empty.
func (*BufferedError) Error ¶
func (b *BufferedError) Error() string
Error formats errors in the buffer into the string.
func (*BufferedError) Format ¶ added in v1.2.0
func (b *BufferedError) Format(f fmt.State, verb rune)
func (*BufferedError) Grow ¶ added in v1.2.0
func (b *BufferedError) Grow(n int)
Grow grows internal errors slice capacity to hold n number of errors. If actual capacity is bigger than n this function is no-op.
func (*BufferedError) Unwrap ¶
func (b *BufferedError) Unwrap() []error
Unwrap returns a copy of the buffer errors.
Click to show internal directories.
Click to hide internal directories.