From 476066108ff8a7a90428522b2a7e187447606b23 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 13 Aug 2013 09:56:37 -0700 Subject: [PATCH] packer: get rid of unused code --- packer/environment.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packer/environment.go b/packer/environment.go index ee6f443fe..f641774ec 100644 --- a/packer/environment.go +++ b/packer/environment.go @@ -266,14 +266,11 @@ func (e *coreEnvironment) Cli(args []string) (result int, err error) { func (e *coreEnvironment) printHelp() { // Created a sorted slice of the map keys and record the longest // command name so we can better format the output later. - i := 0 maxKeyLen := 0 for _, command := range e.commands { if len(command) > maxKeyLen { maxKeyLen = len(command) } - - i++ } // Sort the keys @@ -297,10 +294,10 @@ func (e *coreEnvironment) printHelp() { e.ui.Machine("command", key, synopsis) // Pad the key with spaces so that they're all the same width - key = fmt.Sprintf("%v%v", key, strings.Repeat(" ", maxKeyLen-len(key))) + key = fmt.Sprintf("%s%s", key, strings.Repeat(" ", maxKeyLen-len(key))) // Output the command and the synopsis - e.ui.Say(fmt.Sprintf(" %v %v", key, synopsis)) + e.ui.Say(fmt.Sprintf(" %s %s", key, synopsis)) } e.ui.Say("\nGlobally recognized options:")