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异常拦截处理
- Host: GitHub
- URL: https://github.com/deatil/go-exception
- Owner: deatil
- License: apache-2.0
- Created: 2022-04-03T03:27:34.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-02T06:00:04.000Z (about 3 years ago)
- Last Synced: 2025-01-10T10:29:13.983Z (4 months ago)
- Topics: catch, go, go-exception, panic, try
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 异常处理
### 下载安装
~~~go
go get -u github.com/deatil/go-exception
~~~### 使用
~~~go
package mainimport "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) 所有。