From c8a25c6a8b55e330b270496641af1ddf5734db03 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Mon, 21 Dec 2015 15:10:49 -0800 Subject: [PATCH] Fix append issue --- command/agent_info.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/command/agent_info.go b/command/agent_info.go index c4b290787a5..98231df9fd8 100644 --- a/command/agent_info.go +++ b/command/agent_info.go @@ -66,9 +66,11 @@ func (c *AgentInfoCommand) Run(args []string) int { for _, key := range statsKeys { c.Ui.Output(key) statsData, _ := stats[key].(map[string]interface{}) - statsDataKeys := make([]string, 0, len(statsData)) + statsDataKeys := make([]string, len(statsData)) + i := 0 for key := range statsData { - statsDataKeys = append(statsDataKeys, key) + statsDataKeys[i] = key + i++ } sort.Strings(statsDataKeys)