mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-08 07:50:27 +08:00
优化代码
This commit is contained in:
@@ -29,7 +29,7 @@ func (this *errorObj) Error() string {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新错误
|
// New 新错误
|
||||||
func New(errText string) error {
|
func New(errText string) error {
|
||||||
ptr, file, line, ok := runtime.Caller(1)
|
ptr, file, line, ok := runtime.Caller(1)
|
||||||
funcName := ""
|
funcName := ""
|
||||||
@@ -45,7 +45,7 @@ func New(errText string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 包装已有错误
|
// Wrap 包装已有错误
|
||||||
func Wrap(err error) error {
|
func Wrap(err error) error {
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user