An open API service indexing awesome lists of open source software.

https://github.com/deatil/go-exception

go panic异常拦截处理
https://github.com/deatil/go-exception

catch go go-exception panic try

Last synced: 3 months ago
JSON representation

go panic异常拦截处理

Awesome Lists containing this project

README

        

## 异常处理

### 下载安装

~~~go
go get -u github.com/deatil/go-exception
~~~

### 使用

~~~go
package main

import "github.com/deatil/go-exception/exception"

exception.
Try(func() {
panic("exception error")
}).
Catch(func(e exception.Exception) {
fmt.Println(e.GetMessage())
})

~~~

### 开源协议

* 本软件包遵循 `Apache2` 开源协议发布,在保留本软件包版权的情况下提供个人及商业免费使用。

### 版权

* 本软件包所属版权归 deatil(https://github.com/deatil) 所有。