MCPcopy Create free account
hub / github.com/compose-spec/compose-go / check

Function check

validation/validation.go:43–66  ·  view source on GitHub ↗
(value any, p tree.Path)

Source from the content-addressed store, hash-verified

41}
42
43func check(value any, p tree.Path) error {
44 for pattern, fn := range checks {
45 if p.Matches(pattern) {
46 return fn(value, p)
47 }
48 }
49 switch v := value.(type) {
50 case map[string]any:
51 for k, v := range v {
52 err := check(v, p.Next(k))
53 if err != nil {
54 return err
55 }
56 }
57 case []any:
58 for _, e := range v {
59 err := check(e, p.Next("[]"))
60 if err != nil {
61 return err
62 }
63 }
64 }
65 return nil
66}
67
68func checkFileObject(keys ...string) checkerFunc {
69 return func(value any, p tree.Path) error {

Callers 1

ValidateFunction · 0.85

Calls 2

MatchesMethod · 0.80
NextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…