Make boolean attributes more useable

This commit is contained in:
2020-05-25 15:18:17 -06:00
parent a671ad57e2
commit 4cb7457606
9 changed files with 109 additions and 32 deletions

View File

@ -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",
}