New
This commit is contained in:
19
internal/errors/errors.go
Normal file
19
internal/errors/errors.go
Normal file
@@ -0,0 +1,19 @@
|
||||
// Filename: internal/errors/errors.go
|
||||
|
||||
package errors
|
||||
|
||||
import (
|
||||
std_errors "errors" // 为标准库errors包指定别名
|
||||
)
|
||||
|
||||
func Is(err, target error) bool {
|
||||
return std_errors.Is(err, target)
|
||||
}
|
||||
|
||||
func As(err error, target any) bool {
|
||||
return std_errors.As(err, target)
|
||||
}
|
||||
|
||||
func Unwrap(err error) error {
|
||||
return std_errors.Unwrap(err)
|
||||
}
|
||||
Reference in New Issue
Block a user