增加try-cache
This commit is contained in:
31
try/iTry_test.go
Normal file
31
try/iTry_test.go
Normal file
@ -0,0 +1,31 @@
|
||||
// Package try...
|
||||
//
|
||||
// Description : try...
|
||||
//
|
||||
// Author : go_developer@163.com<张德满>
|
||||
//
|
||||
// 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")
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user