Top 1.1% dependent packages on proxy.golang.org
Top 1.2% dependent repos on proxy.golang.org
Top 8.9% forks on proxy.golang.org
Top 1.3% docker downloads on proxy.golang.org
proxy.golang.org : github.com/dsnet/try
Package try emulates aspects of the ill-fated "try" proposal using generics. See https://golang.org/issue/32437 for inspiration. Example usage: This package is a sharp tool and should be used with care. Quick and easy error handling can occlude critical error handling logic. Panic handling generally should not cross package boundaries or be an explicit part of an API. Package try is a good fit for short Go programs and unit tests where development speed is a greater priority than reliability. Since the E functions panic if an error is encountered, recovering in such programs is optional. Code before try: Code after try: The E family of functions all remove a final error return, panicking if non-nil. Handle recovers from that panic and allows assignment of the error to a return error value. Other panics are not recovered. HandleF is like Handle, but it calls a function after any such assignment. F wraps an error with file and line information and calls a function on error. It inter-operates well with testing.TB and log.Fatal. Recover is like F, but it supports more complicated error handling by passing the error and runtime frame directly to a function.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/dsnet/try
License: BSD-3-Clause
Latest release: almost 3 years ago
First release: almost 3 years ago
Namespace: github.com/dsnet
Dependent packages: 29
Dependent repositories: 19
Stars: 121 on GitHub
Forks: 4 on GitHub
Docker dependents: 2
Docker downloads: 1,300
See more repository details: repos.ecosyste.ms
Last synced: 26 days ago