MCPcopy
hub / github.com/benbjohnson/wtf / Render

Method Render

http/html/html.go:21–34  ·  view source on GitHub ↗
(ctx context.Context, w io.Writer)

Source from the content-addressed store, hash-verified

19}
20
21func (r *Alert) Render(ctx context.Context, w io.Writer) {
22 if r.Err == nil {
23 return
24 }
25
26 fmt.Fprint(w, `<div class="card bg-light mb-3">`)
27 fmt.Fprint(w, `<div class="card-body p-3">`)
28 fmt.Fprint(w, `<p class="fs--1 mb-0 text-danger">`)
29 fmt.Fprint(w, `<i class="fas fa-exclamation-circle mr-2"></i>`)
30 fmt.Fprint(w, html.EscapeString(wtf.ErrorMessage(r.Err)))
31 fmt.Fprint(w, `</p>`)
32 fmt.Fprint(w, `</div>`)
33 fmt.Fprint(w, `</div>`)
34}
35
36// Flash displays the flash message, if available.
37type Flash struct{}

Callers

nothing calls this directly

Calls 1

ErrorMessageFunction · 0.92

Tested by

no test coverage detected