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

Function ApplyExtends

loader/extends.go:30–48  ·  view source on GitHub ↗
(ctx context.Context, dict map[string]any, opts *Options, tracker *cycleTracker, post PostProcessor)

Source from the content-addressed store, hash-verified

28)
29
30func ApplyExtends(ctx context.Context, dict map[string]any, opts *Options, tracker *cycleTracker, post PostProcessor) error {
31 a, ok := dict["services"]
32 if !ok {
33 return nil
34 }
35 services, ok := a.(map[string]any)
36 if !ok {
37 return fmt.Errorf("services must be a mapping")
38 }
39 for name := range services {
40 merged, err := applyServiceExtends(ctx, name, services, opts, tracker, post)
41 if err != nil {
42 return err
43 }
44 services[name] = merged
45 }
46 dict["services"] = services
47 return nil
48}
49
50func applyServiceExtends(ctx context.Context, name string, services map[string]any, opts *Options, tracker *cycleTracker, post PostProcessor) (any, error) {
51 s := services[name]

Callers 1

loadYamlFileFunction · 0.85

Calls 1

applyServiceExtendsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…