diff --git a/pkg/project/v2/project.go b/pkg/project/v2/project.go index cb31999ea..bd530966e 100644 --- a/pkg/project/v2/project.go +++ b/pkg/project/v2/project.go @@ -102,35 +102,33 @@ func (p Project) String() string { // ForEveryConfigDo executes the given ActionOverConfig actions for each configuration defined in the project for each environment // Actions can not modify the configs inside the Project. -func (p Project) ForEveryConfigDo(actions ...ActionOverConfig) { - p.forEveryConfigDo("", actions) +func (p Project) ForEveryConfigDo(action ActionOverConfig) { + p.forEveryConfigDo("", action) } // ForEveryConfigInEnvironmentDo executes the given ActionOverConfig actions for each configuration defined in the project for a given environment. // It behaves like ForEveryConfigDo just limited to a single environment. // Actions can not modify the configs inside the Project. -func (p Project) ForEveryConfigInEnvironmentDo(environment string, actions ...ActionOverConfig) { - p.forEveryConfigDo(environment, actions) +func (p Project) ForEveryConfigInEnvironmentDo(environment string, action ActionOverConfig) { + p.forEveryConfigDo(environment, action) } // forEveryConfigDo applies the given action to every configuration, either for a single environment if requested, // or for all environments if the environemnt parameter is empty. -func (p Project) forEveryConfigDo(environment string, actions []ActionOverConfig) { +func (p Project) forEveryConfigDo(environment string, action ActionOverConfig) { for env, cpt := range p.Configs { if environment == "" || environment == env { - cpt.ForEveryConfigDo(actions...) + cpt.ForEveryConfigDo(action) } } } // ForEveryConfigDo executes the given ActionOverConfig actions for each configuration defined in the ConfigsPerType. // Actions can not modify the configs inside the ConfigsPerType. -func (cpt ConfigsPerType) ForEveryConfigDo(actions ...ActionOverConfig) { +func (cpt ConfigsPerType) ForEveryConfigDo(action ActionOverConfig) { for _, cs := range cpt { for _, c := range cs { - for _, f := range actions { - f(c) - } + action(c) } } }