Validate reports whether the origin contains a supported kind and non-empty reference.
(path string)
| 374 | |
| 375 | // Validate reports whether the origin contains a supported kind and non-empty reference. |
| 376 | func (o Origin) Validate(path string) error { |
| 377 | if err := o.Kind.Validate(nestedPath(path, "kind")); err != nil { |
| 378 | return err |
| 379 | } |
| 380 | if strings.TrimSpace(o.Ref) == "" { |
| 381 | return fmt.Errorf("%w: %s is required", ErrValidation, nestedPath(path, "ref")) |
| 382 | } |
| 383 | return nil |
| 384 | } |
| 385 | |
| 386 | // Validate reports whether the authority flags are internally consistent. |
| 387 | func (a Authority) Validate(path string) error { |
no test coverage detected