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

wrap

package module
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 2 Imported by: 13

README

wrap

License Go Report Card Tests Codecov PkgGoDev Release GitHub go.mod Go version

Golang package to wrap things into a bit of context

Documentation

Overview

Package wrap contains code to simply wrap things into a bit of context.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error deprecated

func Error(err error, context string) error

Error creates an error with additional context

Deprecated: Use fmt.Errorf() instead using the `%w` format specifier.

func Errorf deprecated

func Errorf(err error, format string, a ...interface{}) error

Errorf creates an error with additional formatted context

Deprecated: Use fmt.Errorf() instead using the `%w` format specifier.

func Errors deprecated added in v1.1.0

func Errors(errs []error, context string) error

Errors creates a list of errors with additional context

Deprecated: Use fmt.Errorf() and errors.Join() instead.

func Errorsf deprecated added in v1.1.0

func Errorsf(errors []error, format string, a ...interface{}) error

Errorsf creates a list of errors with additional formatted context

Deprecated: Use fmt.Errorf() and errors.Join() instead.

Types

type ContextError deprecated

type ContextError interface {
	Context() string
	Cause() error
}

ContextError interface describes the simple type that is able to provide a textual context as well as the cause explaining the underlying error.

Deprecated: Discontinued, use fmt.Errorf() instead.

type ListOfErrors deprecated added in v1.1.0

type ListOfErrors interface {
	Context() string
	Errors() []error
}

ListOfErrors interface describes a list of errors with additional context information with an explanation.

Deprecated: Discontinued, use errors.Join() instead.

Jump to

Keyboard shortcuts

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