aliases.go 574 B

123456789101112131415161718192021222324252627
  1. package errors
  2. import (
  3. "errors"
  4. "fmt"
  5. )
  6. var (
  7. // Is is an alias of the standard errors.Is function.
  8. Is = errors.Is
  9. // As is an alias of the standard errors.As function.
  10. As = errors.As
  11. // New is an alias of the standard errors.New function.
  12. New = errors.New
  13. // Unwrap is an alias of the standard errors.Unwrap function.
  14. Unwrap = errors.Unwrap
  15. // Join is an alias of the standard errors.Join function.
  16. Join = errors.Join
  17. )
  18. func sprintf(format string, args ...interface{}) string {
  19. if len(args) > 0 {
  20. return fmt.Sprintf(format, args...)
  21. }
  22. return format
  23. }