Registry / utility / dsnet-try

dsnet-try

JSON →
library0.0.3gogounverified

Emulates the 'try' proposal using generics for concise error handling in Go.

go get github.com/dsnet/try
INSTALL
IMPORT
SIG · DSNET-TRY
D
dsnet-try
utilitygov0.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

try
github.com/dsnet/try

Uses try.E to handle errors concisely with a deferred handler.

package main import ( "fmt" "github.com/dsnet/try" ) func main() { defer try.Handle(func(err error) { fmt.Println(err) }) val := try.E(strconv.Atoi("42")) fmt.Println(val) }
Debug
Known issues
gotchaPanics may cross package boundaries if not recovered properly.
fix
Always use try.Handle or try.HandleF to recover panics within the same function.
affects: >=0.0.0
Upgrade
Version history
0.0.3latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
dsnet-try — go get dsnet-try · libregistry