NameValues.CopyOn: don't instanciate a receiving map if there is nothing to copy over

pull/8889/head
Adrien Delorme 6 years ago
parent b15c92bc1e
commit 3beea4fb94

@ -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…
Cancel
Save