@@ -27,7 +27,7 @@ import (
2727 "github.com/compose-spec/compose-go/v2/types"
2828)
2929
30- func ApplyExtends (ctx context.Context , dict map [string ]any , opts * Options , tracker * cycleTracker , post ... PostProcessor ) error {
30+ func ApplyExtends (ctx context.Context , dict map [string ]any , opts * Options , tracker * cycleTracker , post PostProcessor ) error {
3131 a , ok := dict ["services" ]
3232 if ! ok {
3333 return nil
@@ -37,7 +37,7 @@ func ApplyExtends(ctx context.Context, dict map[string]any, opts *Options, track
3737 return fmt .Errorf ("services must be a mapping" )
3838 }
3939 for name := range services {
40- merged , err := applyServiceExtends (ctx , name , services , opts , tracker , post ... )
40+ merged , err := applyServiceExtends (ctx , name , services , opts , tracker , post )
4141 if err != nil {
4242 return err
4343 }
@@ -47,7 +47,7 @@ func ApplyExtends(ctx context.Context, dict map[string]any, opts *Options, track
4747 return nil
4848}
4949
50- func applyServiceExtends (ctx context.Context , name string , services map [string ]any , opts * Options , tracker * cycleTracker , post ... PostProcessor ) (any , error ) {
50+ func applyServiceExtends (ctx context.Context , name string , services map [string ]any , opts * Options , tracker * cycleTracker , post PostProcessor ) (any , error ) {
5151 s := services [name ]
5252 if s == nil {
5353 return nil , nil
@@ -81,7 +81,7 @@ func applyServiceExtends(ctx context.Context, name string, services map[string]a
8181
8282 var (
8383 base any
84- processor PostProcessor = NoopPostProcessor {}
84+ processor = post
8585 )
8686
8787 if file != nil {
@@ -114,16 +114,15 @@ func applyServiceExtends(ctx context.Context, name string, services map[string]a
114114 }
115115 source := deepClone (base ).(map [string ]any )
116116
117- for _ , processor := range post {
118- err = processor .Apply (map [string ]any {
119- "services" : map [string ]any {
120- name : source ,
121- },
122- })
123- if err != nil {
124- return nil , err
125- }
117+ err = post .Apply (map [string ]any {
118+ "services" : map [string ]any {
119+ name : source ,
120+ },
121+ })
122+ if err != nil {
123+ return nil , err
126124 }
125+
127126 merged , err := override .ExtendService (source , service )
128127 if err != nil {
129128 return nil , err
0 commit comments