Merge pull request #32156 from cpuguy83/index_copy_new_slice

Don't pass reference to mutable slice
Upstream-commit: 95510551cea4a1211070ecdc5f1319f5aa2c9a7c
Component: engine
This commit is contained in:
Vincent Demeester
2017-03-28 10:23:08 +02:00
committed by GitHub
+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