Added space-delimited string list attrib type

This commit is contained in:
2019-05-29 21:32:16 -06:00
parent d24afba75c
commit 69b1e1644d
4 changed files with 34 additions and 21 deletions

View File

@ -61,6 +61,16 @@ var attribTypes = map[string]AttribTypeInfo{
Template: simpleTemplate("float32", "strconv.FormatFloat(float64(%s), 'G', -1, 32)"),
Imports: []string{"strconv"},
},
"space list": {
Template: `func %s(value ...string) hatmill.Attrib {
return hatmill.Attrib{
Key: "%s",
Value: strings.Join(value, " "),
}
}
`,
Imports: []string{"strings"},
},
}
// Def represents a top-level definition and its required imports.