()
| 52 | } |
| 53 | |
| 54 | func (tcf Block) Do() { |
| 55 | if tcf.Finally != nil { |
| 56 | |
| 57 | defer tcf.Finally() |
| 58 | } |
| 59 | if tcf.Catch != nil { |
| 60 | defer func() { |
| 61 | if r := recover(); r != nil { |
| 62 | tcf.Catch(r) |
| 63 | } |
| 64 | }() |
| 65 | } |
| 66 | tcf.Try() |
| 67 | } |
| 68 | |
| 69 | // 重试 |
| 70 | func Retry(attempts uint, sleep time.Duration, f func() error) (err error) { |
no outgoing calls
no test coverage detected