Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 6.0% on proxy.golang.org
Top 0.1% dependent packages on proxy.golang.org
Top 0.1% dependent repos on proxy.golang.org
Top 0.1% docker downloads on proxy.golang.org

proxy.golang.org : gopkg.in/warnings.v0

Package warnings implements error handling with non-fatal errors (warnings). A recurring pattern in Go programming is the following: This pattern allows interrupting the flow on any received error. But what if there are errors that should be noted but still not fatal, for which the flow should not be interrupted? Implementing such logic at each if statement would make the code complex and the flow much harder to follow. Package warnings provides the Collector type and a clean and simple pattern for achieving such logic. The Collector takes care of deciding when to break the flow and when to continue, collecting any non-fatal errors (warnings) along the way. The only requirement is that fatal and non-fatal errors can be distinguished programmatically; that is a function such as must be implemented. The following is an example of what the above snippet could look like using the warnings package: For an example of a non-trivial code base using this library, see gopkg.in/gcfg.v1 Rules for using warnings TODO

Registry - Source - Documentation - JSON
purl: pkg:golang/gopkg.in/warnings.v0
License: BSD-2-Clause
Latest release: over 6 years ago
First release: almost 8 years ago
Namespace: gopkg.in
Dependent packages: 6,987
Dependent repositories: 40,961
Stars: 2 on GitHub
Forks: 1 on GitHub
Docker dependents: 3,048
Docker downloads: 16,470,668,658
See more repository details: repos.ecosyste.ms
Last synced: 27 days ago

    Loading...
    Readme
    Loading...