Don't pass reference to mutable slice

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d5b7839008f80a82063869c43ee197a3b6781ca3
Component: engine
This commit is contained in:
Brian Goff
2017-03-27 21:23:06 -04:00
parent e4f4018baa
commit 80739547ec
+6 -1
View File
@@ -98,7 +98,12 @@ func (r *Registrar) GetNames(key string) ([]string, error) {
if !exists {
return nil, ErrNoSuchKey
}
return names, nil
ls := make([]string, 0, len(names))
for _, n := range names {
ls = append(ls, n)
}
return ls, nil
}
// Get returns the key that the passed in name is reserved to