2022-02-24 22:49:46 +01:00
|
|
|
package errors
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
// Is is an alias of the standard errors.Is function.
|
|
|
|
Is = errors.Is
|
|
|
|
// As is an alias of the standard errors.As function.
|
|
|
|
As = errors.As
|
|
|
|
// New is an alias of the standard errors.New function.
|
|
|
|
New = errors.New
|
|
|
|
// Unwrap is an alias of the standard errors.Unwrap function.
|
|
|
|
Unwrap = errors.Unwrap
|
2024-01-04 02:33:00 +01:00
|
|
|
// Join is an alias of the standard errors.Join function.
|
|
|
|
Join = errors.Join
|
2022-02-24 22:49:46 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func sprintf(format string, args ...interface{}) string {
|
|
|
|
if len(args) > 0 {
|
|
|
|
return fmt.Sprintf(format, args...)
|
|
|
|
}
|
|
|
|
|
|
|
|
return format
|
|
|
|
}
|