mirror of https://github.com/q191201771/naza
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
247 B
Go
19 lines
247 B
Go
6 years ago
|
package errors
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
"errors"
|
||
|
)
|
||
|
|
||
|
func TestPanicIfErrorOccur(t *testing.T) {
|
||
|
PanicIfErrorOccur(nil)
|
||
|
|
||
|
defer func() {
|
||
|
if err := recover(); err != nil {
|
||
|
fmt.Println(err)
|
||
|
}
|
||
|
}()
|
||
|
PanicIfErrorOccur(errors.New("fxxk."))
|
||
|
}
|