From 8b22fe29cff3e20a9bb4c48a3baf34edb6ded05f Mon Sep 17 00:00:00 2001 From: Alexandr Bruyako Date: Sun, 30 Jun 2019 23:56:36 +0300 Subject: [PATCH] improved slice copying --- internal/options/options.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/options/options.go b/internal/options/options.go index 2a3be2254..f03eb6097 100644 --- a/internal/options/options.go +++ b/internal/options/options.go @@ -22,10 +22,8 @@ func Register(ns string, cfg interface{}) { // List returns a list of all registered options (using Register()). func List() (list []Help) { - list = make([]Help, 0, len(opts)) - for _, opt := range opts { - list = append(list, opt) - } + list = make([]Help, len(opts)) + copy(list, opts) return list }