MCPcopy Create free account
hub / github.com/goadesign/goa / Write

Method Write

codegen/file.go:121–126  ·  view source on GitHub ↗

Write writes the section to the given writer.

(w io.Writer)

Source from the content-addressed store, hash-verified

119
120// Write writes the section to the given writer.
121func (s *SectionTemplate) Write(w io.Writer) error {
122 funcs := TemplateFuncs()
123 maps.Copy(funcs, s.FuncMap)
124 tmpl := template.Must(template.New(s.Name).Funcs(funcs).Parse(s.Source))
125 return tmpl.Execute(w, s.Data)
126}
127
128// finalizeGoSource processes Go source entirely in memory without file I/O
129func finalizeGoSource(path string, content []byte) ([]byte, error) {

Callers 15

FlagsCodeFunction · 0.95
RenderMethod · 0.45
TestHeaderFunction · 0.45
sectionCodeWithPrefixFunction · 0.45
TestExampleServerFilesFunction · 0.45
TestExampleCLIFilesFunction · 0.45
GenerateFunction · 0.45
TestServiceFunction · 0.45
TestStructPkgPathFunction · 0.45

Calls 2

TemplateFuncsFunction · 0.85
ExecuteMethod · 0.80

Tested by 14

TestHeaderFunction · 0.36
TestExampleServerFilesFunction · 0.36
TestExampleCLIFilesFunction · 0.36
TestServiceFunction · 0.36
TestStructPkgPathFunction · 0.36
TestViewsFunction · 0.36
TestExampleServiceFilesFunction · 0.36
TestClientFunction · 0.36
TestInterceptorsFunction · 0.36