MCPcopy Create free account
hub / github.com/compozy/agh / Validate

Method Validate

internal/task/validate.go:360–368  ·  view source on GitHub ↗

Validate reports whether the ownership value contains a supported kind and non-empty reference.

(path string)

Source from the content-addressed store, hash-verified

358
359// Validate reports whether the ownership value contains a supported kind and non-empty reference.
360func (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.
371func (o Ownership) IsZero() bool {

Callers 1

Calls 2

nestedPathFunction · 0.70
ValidateMethod · 0.65

Tested by

no test coverage detected