mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Don't pass reference to mutable slice
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
3c22c7d5e9
commit
d5b7839008
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue