23 Unstar Star 67 Fork 13

88250 / guluGo

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
Clone or download
panic_test.go 804 Bytes
Copy Edit Raw Blame History
// Gulu - Golang common utilities for everyone.
// Copyright (c) 2019-present, b3log.org
//
// LianDi is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
package gulu
import (
"sync"
"testing"
)
func TestRecover(t *testing.T) {
var err error
wg := sync.WaitGroup{}
wg.Add(1)
go func() {
defer wg.Done()
defer Panic.Recover(&err)
panic("test panic")
}()
wg.Wait()
t.Log(err)
}
Go
1
https://gitee.com/dl88250/gulu.git
git@gitee.com:dl88250/gulu.git
dl88250
gulu
gulu
master

Search