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

Function renderFileToString

http/codegen/websocket_golden_test.go:17–25  ·  view source on GitHub ↗

renderFileToString renders all sections of a file to a string without writing to disk

(file *codegen.File)

Source from the content-addressed store, hash-verified

15
16// renderFileToString renders all sections of a file to a string without writing to disk
17func renderFileToString(file *codegen.File) (string, error) {
18 var buf bytes.Buffer
19 for _, section := range file.SectionTemplates {
20 if err := section.Write(&buf); err != nil {
21 return "", err
22 }
23 }
24 return buf.String(), nil
25}
26
27// TestWebSocketGoldenFiles tests WebSocket code generation against golden files
28// to ensure comprehensive coverage of all WebSocket templates and scenarios.

Callers 2

TestWebSocketGoldenFilesFunction · 0.85

Calls 2

StringMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected