fix: tests

This commit is contained in:
yusing
2025-04-24 15:09:46 +08:00
parent 663a107c06
commit d668b03175
4 changed files with 57 additions and 66 deletions

View File

@@ -41,18 +41,6 @@ func Wrap(err error, message ...string) Error {
return &baseError{fmt.Errorf("%s: %w", message[0], err)}
}
func wrap(err error) Error {
if err == nil {
return nil
}
//nolint:errorlint
switch err := err.(type) {
case Error:
return err
}
return &baseError{err}
}
func Unwrap(err error) Error {
//nolint:errorlint
switch err := err.(type) {
@@ -65,6 +53,18 @@ func Unwrap(err error) Error {
}
}
func wrap(err error) Error {
if err == nil {
return nil
}
//nolint:errorlint
switch err := err.(type) {
case Error:
return err
}
return &baseError{err}
}
func IsJSONMarshallable(err error) bool {
switch err := err.(type) {
case *nestedError, *withSubject: