mirror of
https://github.com/octoleo/restic.git
synced 2024-10-31 19:02:32 +00:00
improved slice copying
This commit is contained in:
parent
02014be76c
commit
8b22fe29cf
@ -22,10 +22,8 @@ func Register(ns string, cfg interface{}) {
|
|||||||
|
|
||||||
// List returns a list of all registered options (using Register()).
|
// List returns a list of all registered options (using Register()).
|
||||||
func List() (list []Help) {
|
func List() (list []Help) {
|
||||||
list = make([]Help, 0, len(opts))
|
list = make([]Help, len(opts))
|
||||||
for _, opt := range opts {
|
copy(list, opts)
|
||||||
list = append(list, opt)
|
|
||||||
}
|
|
||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user