From 8a78de02c705a87959f0a7754fcd05cc09d40296 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 8 May 2013 17:11:02 -0700 Subject: [PATCH] packer: Cleaner way to build up a list of names --- packer/template.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packer/template.go b/packer/template.go index a0fb2b4c8..23daecfc7 100644 --- a/packer/template.go +++ b/packer/template.go @@ -81,11 +81,9 @@ func ParseTemplate(data []byte) (t *Template, err error) { // BuildNames returns a slice of the available names of builds that // this template represents. func (t *Template) BuildNames() []string { - names := make([]string, len(t.Builders)) - i := 0 + names := make([]string, 0, len(t.Builders)) for name, _ := range t.Builders { - names[i] = name - i++ + names = append(names, name) } return names