renderFileToString renders all sections of a file to a string without writing to disk
(file *codegen.File)
| 15 | |
| 16 | // renderFileToString renders all sections of a file to a string without writing to disk |
| 17 | func 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. |
no test coverage detected