Comment by YetAnotherNick

1 day ago

What does this mean? Do they just use recover and keep bad data?

> The standard library does that. fmt.Print when calling .String(), and the standard library HTTP server does that, for exceptions in the HTTP handlers.

Apart from this most doesn't seem that big of a deal, except for `append` which is truly a bad syntax. If you doing it inplace append don't return the value.

The standard library recovers from the panic, and program continues.

This means that if you do:

    func (f Foo) String() string {
      some.Lock()
      t := get_something()
      some.Unlock()
      t = transform_it(t)
      return t
    }

And `get_something()` panics, then the program continues with a locked mutex. There are more dangerous things than a deadlocked program, of course.

It's non-optional to use defer, and thus write exception safe code. Even if you never use exceptions.