MCPcopy
hub / github.com/cweill/gotests / LoadFromData

Method LoadFromData

internal/render/render.go:80–84  ·  view source on GitHub ↗

LoadFromData allows to load from a data slice

(templateData [][]byte)

Source from the content-addressed store, hash-verified

78
79// LoadFromData allows to load from a data slice
80func (r *Render) LoadFromData(templateData [][]byte) {
81 for _, d := range templateData {
82 r.tmpls = template.Must(r.tmpls.Parse(string(d)))
83 }
84}
85
86// Header renders the file header including package declaration and imports.
87func (r *Render) Header(w io.Writer, h *models.Header) error {

Callers 2

ProcessMethod · 0.80
TestRender_LoadFromDataFunction · 0.80

Calls 1

ParseMethod · 0.80

Tested by 1

TestRender_LoadFromDataFunction · 0.64