Re: [go-nuts] Re: Error Handling Question

2022-10-24 Thread Andrew Harris
> In many cases, including in the standard libraries, there are functions that return errors and then accompanying functions with names like MustFoo() that just call Foo() and panic if there's an error. At least inside the standard lib, the uses of MustXxx document why they behave the way they

Re: [go-nuts] Re: Error Handling Question

2022-10-24 Thread Robert Engels
Dan, If it walks like a duckā€¦ You make a great case why Go should have checked exceptions. If anything the Go error handling model tries to be checked exceptions - every error should be explicitly handled - without any of the conveniences of exceptions - common blocks, stack traces and call st

[go-nuts] Re: Error Handling Question

2022-10-24 Thread Harri L
Hi, On Friday, October 21, 2022 at 12:14:52 AM UTC+3 dple...@google.com wrote: > > var x0 float > try { >x0 = check DoSomeMath(check FetchSomething(), check ComputeSomething()) > } handle err { >log.Info("Unable to estimate initial approximation, defaulting to 1...") >x0 = 1 > } > //