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

Function SectionsCode

codegen/testing.go:36–42  ·  view source on GitHub ↗

SectionsCode generates and formats the code for the given sections.

(t *testing.T, sections []*SectionTemplate)

Source from the content-addressed store, hash-verified

34
35// SectionsCode generates and formats the code for the given sections.
36func SectionsCode(t *testing.T, sections []*SectionTemplate) string {
37 codes := make([]string, len(sections))
38 for i, section := range sections {
39 codes[i] = sectionCodeWithPrefix(t, section, "package foo\n")
40 }
41 return strings.Join(codes, "\n")
42}
43
44// SectionCodeFromImportsAndMethods generates and formats the code for given import and method definition sections.
45func SectionCodeFromImportsAndMethods(t *testing.T, importSection, methodSection *SectionTemplate) string {

Callers 8

TestServerGRPCInterfaceFunction · 0.92
TestServerHandlerInitFunction · 0.92
TestRequestDecoderFunction · 0.92
TestResponseEncoderFunction · 0.92
TestClientEndpointInitFunction · 0.92
TestRequestEncoderFunction · 0.92
TestResponseDecoderFunction · 0.92

Calls 1

sectionCodeWithPrefixFunction · 0.85

Tested by 8

TestServerGRPCInterfaceFunction · 0.74
TestServerHandlerInitFunction · 0.74
TestRequestDecoderFunction · 0.74
TestResponseEncoderFunction · 0.74
TestClientEndpointInitFunction · 0.74
TestRequestEncoderFunction · 0.74
TestResponseDecoderFunction · 0.74