Your code reminded me of my old library, mustbe. With mustbe, the code looks like this:
funcSomeBigFunctionWithCollect()(iint,errerror){defermustbe.Catched(func(eerror){fmt.Println("Error in SomeBigFunction:",e)err=e})mustbe.OK(SomeErrorProneFunction())mustbe.OKVal(AnotherFunc())// ...i=mustbe.OKVal(LastFunc()).(int)return}
It's a bit more verbose, but it works already in Go1. Under the hood it uses panics, of course.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Your code reminded me of my old library, mustbe. With mustbe, the code looks like this:
It's a bit more verbose, but it works already in Go1. Under the hood it uses panics, of course.