You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would mean that a literal template and a layout file (or vice versa) could be mixed in the same call. What do you think? If I implemented this would you merge it? The original API would still work.
In client code:
// Order of arguments is irrelevantoutput:=mustache.Render(
mustache.Literal( "Here's my data: {{myData}}" ),
mustache.LayoutFilename("./defaultlayout.mustache"),
map[string]string{"myData":"Yes, this is my data"} )
In mustache.go:
typedataTypeintconst (
uninitialisedDataTypedataType=iotatemplateLiteraltemplateFilenamelayoutLiterallayoutFilename
)
typetemplateDescriptionstruct {
dataTypedatastring
}
funcRender(args...interface{}) string {
// If the first argument is a string then behave as original API// If using new API then only use the first occurrences of template and layout// ...
}
funcLiteral(templatestring) templateDescription {
returntemplateDescription{templateLiteral, template}
}
funcFilename(filenamestring) templateDescription {
returntemplateDescription{templateFilename, filename}
}
funcLayoutLiteral(templatestring) templateDescription {
returntemplateDescription{layoutLiteral, template}
}
funcLayoutFilename(filenamestring) templateDescription {
returntemplateDescription{layoutFilename, filename}
}
The text was updated successfully, but these errors were encountered:
This would mean that a literal template and a layout file (or vice versa) could be mixed in the same call. What do you think? If I implemented this would you merge it? The original API would still work.
In client code:
In mustache.go:
The text was updated successfully, but these errors were encountered: