Commit 8a78de02 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer: Cleaner way to build up a list of names

parent 198f984b
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment