Closed kamilsk closed 3 years ago
func shutdown(err error) { code := 1 if recovered, is := errors.Unwrap(err).(errors.Recovered); is { unsafe.DoSilent(fmt.Fprintf(stderr, "recovered: %+v\n", recovered.Cause())) unsafe.DoSilent(fmt.Fprintln(stderr, "---")) unsafe.DoSilent(fmt.Fprintf(stderr, "%+v\n", err)) } if silent, is := errors.Unwrap(err).(errors.Silent); is { code = silent.code if silent.message { ... } } exit(code) }