MCPcopy Index your code
hub / github.com/subtrace/subtrace / fallback

Function fallback

devtools/devtools.go:25–36  ·  view source on GitHub ↗
(msg string)

Source from the content-addressed store, hash-verified

23)
24
25func fallback(msg string) []byte {
26 b := new(bytes.Buffer)
27 fmt.Fprintf(b, `<!DOCTYPE html>`)
28 fmt.Fprintf(b, `<html>`)
29 fmt.Fprintf(b, `<head><meta charset="utf-8"><title>Subtrace</title></head>`)
30 fmt.Fprintf(b, `<style>* { box-sizing: border-box; }</style>`)
31 fmt.Fprintf(b, `<style>body { margin: 2rem 1rem; display: flex; justify-content: center; font-family: monospace; font-size: 11px; }</style>`)
32 fmt.Fprintf(b, `<style>div { padding: 1rem; width: 100%%; max-width: 24rem; border: 1px solid #00000020; border-radius: 2px; text-align: center; }</style>`)
33 fmt.Fprintf(b, `<body><div>%s</div></body>`, msg)
34 fmt.Fprintf(b, `</html>`)
35 return b.Bytes()
36}
37
38//go:embed bundle
39var bundle embed.FS

Callers 1

bundleOnceFunction · 0.85

Calls 1

BytesMethod · 0.45

Tested by

no test coverage detected