Hi mcesar, thanks for putting this together! I'm thinking about using this for our project...
Curious if anyone would like to share their experience employing this library? On Tuesday, September 21, 2021 at 1:57:38 PM UTC-7 mces...@gmail.com wrote: > With go 1.18 generics implementation it is now possible to provide error > handling functions in a fashion similar to the "try" proposal. I wrote a > small library that implements this approach: > https://github.com/mcesar/must. > > An example of usage is as follows: > > package main > import ( > "fmt" > "os" > "github.com/mcesar/must" > ) > func main() { > fmt.Println(f()) > } > func f() (err error) { > defer must.Handle(&err) > f := must.Do(os.Open("file")) > defer f.Close() > // ... > return nil > } > > This idea is not new, but I think it is worthwhile to have an > implementation to experiment with. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/05caa685-1276-4019-ac3c-de69a73b65b9n%40googlegroups.com.