Fix the commands.GetTemplates() and types.StrategyStrs() completion
functions to avoid showing empty entries.
Reported-by: pam79
Reported-by: inwit <inwit@sindominio.net>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
---
commands/commands.go | 2 +-
worker/types/mfs.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/commands/commands.go b/commands/commands.go
index a06e8ef9..19bb5d66 100644
--- a/commands/commands.go
+++ b/commands/commands.go
@@ -308,7 +308,7 @@ func GetTemplates(arg string) []string {
}
}
}
- names := make([]string, len(templates))
+ names := make([]string, 0, len(templates))
for n := range templates {
names = append(names, n)
}
diff --git a/worker/types/mfs.go b/worker/types/mfs.go
index 071eda1d..a842082f 100644
--- a/worker/types/mfs.go
+++ b/worker/types/mfs.go
@@ -25,7 +25,7 @@ var StrToStrategy = map[string]MultiFileStrategy{
}
func StrategyStrs() []string {
- strs := make([]string, len(StrToStrategy))
+ strs := make([]string, 0, len(StrToStrategy))
for s := range StrToStrategy {
strs = append(strs, s)
}
--
2.47.0