This commit is contained in:
Valentin Maerten
2025-01-05 10:42:34 +01:00
parent 08bd0d982a
commit d3e0fc9eea
2 changed files with 22 additions and 9 deletions

View File

@@ -4,12 +4,10 @@ import (
"fmt"
"sync"
"github.com/go-task/task/v3/errors"
"github.com/go-task/task/v3/internal/deepcopy"
"gopkg.in/yaml.v3"
"github.com/go-task/task/v3/errors"
)
// Precondition represents a precondition necessary for a task to run
@@ -25,6 +23,12 @@ type (
}
)
func NewPreconditions() *Preconditions {
return &Preconditions{
Preconditions: make([]*Precondition, 0),
}
}
func (p *Preconditions) DeepCopy() *Preconditions {
if p == nil {
return nil
@@ -46,12 +50,6 @@ func (p *Precondition) DeepCopy() *Precondition {
}
}
func NewPreconditions() *Preconditions {
return &Preconditions{
Preconditions: make([]*Precondition, 0),
}
}
// UnmarshalYAML implements yaml.Unmarshaler interface.
func (p *Precondition) UnmarshalYAML(node *yaml.Node) error {
switch node.Kind {