osbuild: add variadic version of Pipeline.AddStage() method
This will allow to conveniently add multiple stages to the pipeline at once, which is useful if a generator function wrapping some functionality generates more than one `Stage`. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
b36c03f20c
commit
acfceb74b2
1 changed files with 9 additions and 0 deletions
|
|
@ -36,3 +36,12 @@ func (p *Pipeline) AddStage(stage *Stage) {
|
|||
p.Stages = append(p.Stages, stage)
|
||||
}
|
||||
}
|
||||
|
||||
// AddStages appends multiple stages to the list of stages of a pipeline. The
|
||||
// stages will be executed in the order they are appended.
|
||||
// If the argument is nil, it is not added.
|
||||
func (p *Pipeline) AddStages(stages ...*Stage) {
|
||||
for _, stage := range stages {
|
||||
p.AddStage(stage)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue