Added explicit bool attribute type
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user