github.com/jub0bs/errutil
Package errutil provides utility functions for working with errors. The advent of errors.As in the standard library predates that of parametric polymorphism (generics) in the language. As a result, errors.As is not as ergonomic, type-safe, or efficient as it ideally could be. Functions As and Find are inspired by several unaccepted proposals (see issues 51945, 56949, and 64771) and aim to address those limitations. In most cases, As can be used as a drop-in replacement for errors.As. Find is a more efficient and arguably more ergonomic alternative to As. Incidentally, the error-inspection draft design proposal suggests that errors.As would have been very similar to Find if the Go team had cracked the parametric-polymorphism nut in time for errors.As's inception in the standard library. In many cases, a call to errors.As can advantageously be refactored to a call to Find.
proxy.golang.org
v0.4.0
3 months ago
6
Links
| Registry | proxy.golang.org |
| Source | Repository |
| Docs | Documentation |
| JSON API | View JSON |
| CodeMeta | codemeta.json |
Package Details
| PURL |
pkg:golang/github.com/jub0bs/errutil
spec |
| License | MIT |
| Namespace | github.com/jub0bs |
| First Release | over 1 year ago |
| Last Synced | 8 days ago |
Repository
| Stars | 37 on GitHub |
| Forks | 0 on GitHub |