MCPcopy
hub / github.com/yusing/godoxy / ExpandVarsToString

Method ExpandVarsToString

internal/route/rules/template.go:35–46  ·  view source on GitHub ↗
(w *httputils.ResponseModifier, r *http.Request)

Source from the content-addressed store, hash-verified

33}
34
35func (tmpl *templateString) ExpandVarsToString(w *httputils.ResponseModifier, r *http.Request) (string, PhaseFlag, error) {
36 if !tmpl.isTemplate {
37 return tmpl.string, PhaseNone, nil
38 }
39
40 var buf strings.Builder
41 phase, err := tmpl.ExpandVars(w, r, &buf)
42 if err != nil {
43 return "", PhaseNone, err
44 }
45 return buf.String(), phase, nil
46}
47
48func (tmpl *templateString) Len() int {
49 return len(tmpl.string)

Callers 1

do_set.goFile · 0.80

Calls 2

ExpandVarsMethod · 0.95
StringMethod · 0.65

Tested by

no test coverage detected