errutil.go 360 B

123456789101112131415
  1. package errutil
  2. // NotFound represents a not found error.
  3. type NotFound interface {
  4. NotFound() bool
  5. }
  6. // IsNotFound returns true if the error is a not found error.
  7. func IsNotFound(err error) bool {
  8. e, ok := err.(NotFound)
  9. return ok && e.NotFound()
  10. }
  11. // Args is a map of key-value pairs to provide additional context of an error.
  12. type Args map[string]any