| 1 |
Source: golang-github-hashicorp-errwrap |
| 2 |
Maintainer: Debian Go Packaging Team <[email protected]> |
| 3 |
Uploaders: Tianon Gravi <[email protected]>, |
| 4 |
Tim Potter <[email protected]>, |
| 5 |
Anthony Fok <[email protected]> |
| 6 |
Section: golang |
| 7 |
Testsuite: autopkgtest-pkg-go |
| 8 |
Priority: optional |
| 9 |
Build-Depends: debhelper-compat (= 13), |
| 10 |
dh-golang, |
| 11 |
golang-any |
| 12 |
Standards-Version: 4.5.1 |
| 13 |
Vcs-Browser: https://salsa.debian.org/go-team/packages/golang-github-hashicorp-errwrap |
| 14 |
Vcs-Git: https://salsa.debian.org/go-team/packages/golang-github-hashicorp-errwrap.git |
| 15 |
Homepage: https://github.com/hashicorp/errwrap |
| 16 |
Rules-Requires-Root: no |
| 17 |
XS-Go-Import-Path: github.com/hashicorp/errwrap |
| 18 |
|
| 19 |
Package: golang-github-hashicorp-errwrap-dev |
| 20 |
Architecture: all |
| 21 |
Depends: ${shlibs:Depends}, |
| 22 |
${misc:Depends} |
| 23 |
Multi-Arch: foreign |
| 24 |
Description: Errwrap is a Go (golang) library for wrapping and querying errors |
| 25 |
errwrap is a package for Go that formalizes the pattern of wrapping errors and |
| 26 |
checking if an error contains another error. |
| 27 |
. |
| 28 |
There is a common pattern in Go of taking a returned error value and then |
| 29 |
wrapping it (such as with fmt.Errorf) before returning it. The problem with |
| 30 |
this pattern is that you completely lose the original error structure. |
| 31 |
. |
| 32 |
Arguably the correct approach is that you should make a custom structure |
| 33 |
implementing the error interface, and have the original error as a field on |
| 34 |
that structure, such as this example. This is a good approach, but you have to |
| 35 |
know the entire chain of possible rewrapping that happens, when you might just |
| 36 |
care about one. |
| 37 |
. |
| 38 |
errwrap formalizes this pattern (it doesn't matter what approach you use above) |
| 39 |
by giving a single interface for wrapping errors, checking if a specific error |
| 40 |
is wrapped, and extracting that error. |
| 41 |
. |
| 42 |
This package contains the source. |