packer: Get rid of "name" in template, wasn't used for anything

This commit is contained in:
Mitchell Hashimoto 2013-06-15 11:14:44 -07:00
parent d8cdc88cbe
commit 67eaa07cf4
2 changed files with 0 additions and 5 deletions

View File

@ -11,7 +11,6 @@ import (
// "interface{}" pointers since we actually don't know what their contents
// are until we read the "type" field.
type rawTemplate struct {
Name string
Builders []map[string]interface{}
Hooks map[string][]string
Provisioners []map[string]interface{}
@ -21,7 +20,6 @@ type rawTemplate struct {
// The Template struct represents a parsed template, parsed into the most
// completed form it can be without additional processing by the caller.
type Template struct {
Name string
Builders map[string]rawBuilderConfig
Hooks map[string][]string
Provisioners []rawProvisionerConfig
@ -61,7 +59,6 @@ func ParseTemplate(data []byte) (t *Template, err error) {
}
t = &Template{}
t.Name = rawTpl.Name
t.Builders = make(map[string]rawBuilderConfig)
t.Hooks = rawTpl.Hooks
t.Provisioners = make([]rawProvisionerConfig, len(rawTpl.Provisioners))

View File

@ -11,7 +11,6 @@ func TestParseTemplate_Basic(t *testing.T) {
data := `
{
"name": "my-image",
"builders": []
}
`
@ -19,7 +18,6 @@ func TestParseTemplate_Basic(t *testing.T) {
result, err := ParseTemplate([]byte(data))
assert.Nil(err, "should not error")
assert.NotNil(result, "template should not be nil")
assert.Equal(result.Name, "my-image", "name should be correct")
assert.Length(result.Builders, 0, "no builders")
}