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

@@ -131,6 +131,9 @@ func (t *Task) UnmarshalYAML(node *yaml.Node) error {
// DeepCopy creates a new instance of Task and copies
// data by value from the source struct.
func (t *Task) DeepCopy() *Task {
if t == nil {
return nil
}
c := &Task{
Task: t.Task,
Cmds: deepCopySlice(t.Cmds),