aliases.go 495 B

12345678910111213141516171819202122232425
  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. )
  16. func sprintf(format string, args ...interface{}) string {
  17. if len(args) > 0 {
  18. return fmt.Sprintf(format, args...)
  19. }
  20. return format
  21. }