Added explicit bool attribute type
This commit is contained in:
1 parent
01d8048892
commit
e0ccb4549e
4 files changed
+23
-11
No files matched your search
@@ -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