Added explicit bool attribute type

This commit is contained in:
2019-04-26 20:49:10 -06:00
parent 01d8048892
commit e0ccb4549e
4 changed files with 23 additions and 11 deletions

View File

@ -46,6 +46,18 @@ var attribTypes = map[string]AttribTypeInfo{
`,
},
"explicit bool": {
Template: `// %[1]s creates a "%[2]s" attribute
func %[1]s(value bool) hatmill.Attrib {
return hatmill.Attrib{
Key: "%[2]s",
Value: strconv.FormatBool(value),
}
}
`,
Imports: []string{"strconv"},
},
"int": {
Template: `// %[1]s creates a "%[2]s" attribute
func %[1]s(value int) hatmill.Attrib {