mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-22 16:01:43 -04:00
NameValues.CopyOn: don't instanciate a receiving map if there is nothing to copy over
This commit is contained in:
@@ -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{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user