2021-07-24 23:54:34 +08:00
|
|
|
// Package try...
|
|
|
|
//
|
|
|
|
// Description : try...
|
|
|
|
//
|
2021-07-25 19:05:59 +08:00
|
|
|
// Author : go_developer@163.com<白茶清欢>
|
2021-07-24 23:54:34 +08:00
|
|
|
//
|
|
|
|
// Date : 2021-07-24 11:15 下午
|
|
|
|
package try
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"net/url"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
// TestWithNormal ...
|
|
|
|
//
|
|
|
|
// Author : go_developer@163.com<白茶清欢>
|
|
|
|
//
|
|
|
|
// Date : 11:16 下午 2021/7/24
|
|
|
|
func TestWithNormal(t *testing.T) {
|
|
|
|
f := func() {
|
|
|
|
var m *url.URL
|
|
|
|
fmt.Println(m.RawQuery)
|
|
|
|
}
|
|
|
|
WithNormal(f).CatchAll(func(err error) {
|
|
|
|
fmt.Println("捕获异常 :" + err.Error())
|
|
|
|
}).Finally(func() {
|
|
|
|
fmt.Println("这里是final")
|
|
|
|
})
|
|
|
|
}
|