1
0
mirror of https://github.com/go-task/task.git synced 2025-12-03 23:00:00 +02:00

fix: deep copying pointers inside slices (#1072)

This commit is contained in:
Pete Davison
2023-03-25 19:13:06 +00:00
committed by GitHub
parent d72eb009e4
commit cc1fd3d03e
7 changed files with 105 additions and 35 deletions

View File

@@ -18,6 +18,16 @@ type Precondition struct {
Msg string
}
func (p *Precondition) DeepCopy() *Precondition {
if p == nil {
return nil
}
return &Precondition{
Sh: p.Sh,
Msg: p.Msg,
}
}
// UnmarshalYAML implements yaml.Unmarshaler interface.
func (p *Precondition) UnmarshalYAML(node *yaml.Node) error {
switch node.Kind {