
* update staticcheck Don't fork staticcheck: use the upstream version. Remove unneeded SSA loading. * Cache go/analysis facts Don't load unneeded packages for go/analysis. Repeated run of go/analysis linters now 10x faster (2s vs 20s on this repo) than before.
22 lines
414 B
Go
22 lines
414 B
Go
package errorutil
|
|
|
|
import "fmt"
|
|
|
|
// PanicError can be used to not print stacktrace twice
|
|
type PanicError struct {
|
|
recovered interface{}
|
|
stack []byte
|
|
}
|
|
|
|
func NewPanicError(recovered interface{}, stack []byte) *PanicError {
|
|
return &PanicError{recovered: recovered, stack: stack}
|
|
}
|
|
|
|
func (e PanicError) Error() string {
|
|
return fmt.Sprint(e.recovered)
|
|
}
|
|
|
|
func (e PanicError) Stack() []byte {
|
|
return e.stack
|
|
}
|