mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
NameValues.CopyOn: don't instanciate a receiving map if there is nothing to copy over
This commit is contained in:
parent
b15c92bc1e
commit
3beea4fb94
1 changed files with 3 additions and 0 deletions
|
|
@ -10,6 +10,9 @@ type NameValue struct {
|
|||
type NameValues []NameValue
|
||||
|
||||
func (kvs NameValues) CopyOn(to *map[string]string) []error {
|
||||
if len(kvs) == 0 {
|
||||
return nil
|
||||
}
|
||||
if *to == nil {
|
||||
*to = map[string]string{}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue