Skip to content

Commit

Permalink
Tim's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pkazmierczak committed Aug 29, 2022
1 parent 9fc0365 commit c7ad53c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions nomad/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import (
"github.com/miekg/dns"
"github.com/mitchellh/copystructure"
"golang.org/x/crypto/blake2b"
"golang.org/x/exp/slices"
)

var (
Expand Down Expand Up @@ -7721,13 +7722,8 @@ func (t *Template) Copy() *Template {
nt := new(Template)
*nt = *t

if t.Wait != nil {
nt.Wait = t.Wait.Copy()
}

if t.ChangeScript != nil {
nt.ChangeScript = t.ChangeScript.Copy()
}
nt.ChangeScript = t.ChangeScript.Copy()
nt.Wait = t.Wait.Copy()

return nt
}
Expand Down Expand Up @@ -7838,6 +7834,9 @@ func (cs *ChangeScript) Copy() *ChangeScript {
ncs := new(ChangeScript)
*ncs = *cs

// args is a slice!
ncs.Args = slices.Clone(cs.Args)

return ncs
}

Expand Down

0 comments on commit c7ad53c

Please sign in to comment.