MustRender is like Render but panics if an error occurs. Use MustRender in examples or CLIs where failures should abort execution instead of being handled explicitly.
(title, content string)
| 229 | // Use MustRender in examples or CLIs where failures should abort execution |
| 230 | // instead of being handled explicitly. |
| 231 | func (b *Box) MustRender(title, content string) string { |
| 232 | s, err := b.Render(title, content) |
| 233 | if err != nil { |
| 234 | panic(err) |
| 235 | } |
| 236 | return s |
| 237 | } |
| 238 | |
| 239 | // Render generates the box with the given title and content. |
| 240 | // |