RenderTemplateString is a shortcut and renders a template string directly.
(s string, ctx Context)
| 253 | |
| 254 | // RenderTemplateString is a shortcut and renders a template string directly. |
| 255 | func (set *TemplateSet) RenderTemplateString(s string, ctx Context) (string, error) { |
| 256 | set.markFirstTemplateCreated() |
| 257 | |
| 258 | tpl := Must(set.FromString(s)) |
| 259 | result, err := tpl.Execute(ctx) |
| 260 | if err != nil { |
| 261 | return "", err |
| 262 | } |
| 263 | return result, nil |
| 264 | } |
| 265 | |
| 266 | // RenderTemplateBytes is a shortcut and renders template bytes directly. |
| 267 | func (set *TemplateSet) RenderTemplateBytes(b []byte, ctx Context) (string, error) { |
nothing calls this directly
no test coverage detected