Validate reports whether the ownership value contains a supported kind and non-empty reference.
(path string)
| 358 | |
| 359 | // Validate reports whether the ownership value contains a supported kind and non-empty reference. |
| 360 | func (o Ownership) Validate(path string) error { |
| 361 | if err := o.Kind.Validate(nestedPath(path, "kind")); err != nil { |
| 362 | return err |
| 363 | } |
| 364 | if strings.TrimSpace(o.Ref) == "" { |
| 365 | return fmt.Errorf("%w: %s is required", ErrValidation, nestedPath(path, "ref")) |
| 366 | } |
| 367 | return nil |
| 368 | } |
| 369 | |
| 370 | // IsZero reports whether the ownership value is empty. |
| 371 | func (o Ownership) IsZero() bool { |
no test coverage detected