vendor: update all dependencies
This commit is contained in:
parent
3f0789e2db
commit
08021c4636
2474 changed files with 435818 additions and 282709 deletions
31
vendor/github.com/pengsrc/go-shared/utils/recover_test.go
generated
vendored
Normal file
31
vendor/github.com/pengsrc/go-shared/utils/recover_test.go
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"sync"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/pengsrc/go-shared/log"
|
||||
)
|
||||
|
||||
func TestRecover(t *testing.T) {
|
||||
discardLogger, err := log.NewLogger(ioutil.Discard)
|
||||
assert.NoError(t, err)
|
||||
log.SetGlobalLogger(discardLogger)
|
||||
defer log.SetGlobalLogger(nil)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
wg := sync.WaitGroup{}
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer Recover(ctx)
|
||||
wg.Done()
|
||||
panic("fear")
|
||||
}()
|
||||
wg.Wait()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue