diff --git a/category.go b/category.go index f2cb939..3b405c0 100644 --- a/category.go +++ b/category.go @@ -39,9 +39,9 @@ func (c *commandCategories) AddCommand(category string, command *Command) { } func (c *commandCategories) Categories() []CommandCategory { - ret := []CommandCategory{} - for _, cat := range *c { - ret = append(ret, cat) + ret := make([]CommandCategory, len(*c)) + for i, cat := range *c { + ret[i] = cat } return ret }