增加try-cache

This commit is contained in:
2021-07-24 23:54:34 +08:00
parent 8c67426f0f
commit 34349a0b06
3 changed files with 251 additions and 0 deletions

31
try/iTry_test.go Normal file
View 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")
})
}