From a5954e1369ac87ca5a4cadb727eadec89fb6b17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Pawe=C5=82=20G=C5=82azik?= Date: Thu, 17 Dec 2015 23:53:33 +0100 Subject: [PATCH] small refactor --- command/agent_info.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/command/agent_info.go b/command/agent_info.go index abf83c4f8..c4b290787 100644 --- a/command/agent_info.go +++ b/command/agent_info.go @@ -57,23 +57,23 @@ func (c *AgentInfoCommand) Run(args []string) int { // Sort and output agent info var stats map[string]interface{} stats, _ = info["stats"] - stats_keys := make([]string, 0, len(stats)) + statsKeys := make([]string, 0, len(stats)) for key := range stats { - stats_keys = append(stats_keys, key) + statsKeys = append(statsKeys, key) } - sort.Strings(stats_keys) + sort.Strings(statsKeys) - for _, key := range stats_keys { + for _, key := range statsKeys { c.Ui.Output(key) - d, _ := stats[key].(map[string]interface{}) - d_keys := make([]string, 0, len(d)) - for key := range d { - d_keys = append(d_keys, key) + statsData, _ := stats[key].(map[string]interface{}) + statsDataKeys := make([]string, 0, len(statsData)) + for key := range statsData { + statsDataKeys = append(statsDataKeys, key) } - sort.Strings(d_keys) + sort.Strings(statsDataKeys) - for _, key := range d_keys { - c.Ui.Output(fmt.Sprintf(" %s = %v", key, d[key])) + for _, key := range statsDataKeys { + c.Ui.Output(fmt.Sprintf(" %s = %v", key, statsData[key])) } }