Commit 43fbd26d authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

template: copy some description and min vesrion

parent 839784b0
...@@ -30,6 +30,10 @@ func (r *rawTemplate) Template() (*Template, error) { ...@@ -30,6 +30,10 @@ func (r *rawTemplate) Template() (*Template, error) {
var result Template var result Template
var errs error var errs error
// Copy some literals
result.Description = r.Description
result.MinVersion = r.MinVersion
// Gather the variables // Gather the variables
if len(r.Variables) > 0 { if len(r.Variables) > 0 {
result.Variables = make(map[string]*Variable, len(r.Variables)) result.Variables = make(map[string]*Variable, len(r.Variables))
......
...@@ -243,6 +243,22 @@ func TestParse(t *testing.T) { ...@@ -243,6 +243,22 @@ func TestParse(t *testing.T) {
nil, nil,
true, true,
}, },
{
"parse-description.json",
&Template{
Description: "foo",
},
false,
},
{
"parse-min-version.json",
&Template{
MinVersion: "1.2",
},
false,
},
} }
for _, tc := range cases { for _, tc := range cases {
......
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