Make boolean attributes more useable
This commit is contained in:
@ -40,7 +40,10 @@ func simpleTemplate(paramType, toType string) AttribTemplate {
|
||||
|
||||
func boolTemplate(identifier, name string) string {
|
||||
return fmt.Sprintf(
|
||||
`func %s() hatmill.Attrib {
|
||||
`func %s(showAttrib bool) hatmill.Attrib {
|
||||
if !showAttrib {
|
||||
return hatmill.Attrib{}
|
||||
}
|
||||
return hatmill.Attrib{
|
||||
Key: "%s",
|
||||
}
|
||||
|
Reference in New Issue
Block a user