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

Function SectionCodeFromImportsAndMethods

codegen/testing.go:45–50  ·  view source on GitHub ↗

SectionCodeFromImportsAndMethods generates and formats the code for given import and method definition sections.

(t *testing.T, importSection, methodSection *SectionTemplate)

Source from the content-addressed store, hash-verified

43
44// SectionCodeFromImportsAndMethods generates and formats the code for given import and method definition sections.
45func SectionCodeFromImportsAndMethods(t *testing.T, importSection, methodSection *SectionTemplate) string {
46 t.Helper()
47 var code bytes.Buffer
48 require.NoError(t, importSection.Write(&code))
49 return sectionCodeWithPrefix(t, methodSection, code.String())
50}
51
52func sectionCodeWithPrefix(t *testing.T, section *SectionTemplate, prefix string) string {
53 var code bytes.Buffer

Callers

nothing calls this directly

Calls 3

sectionCodeWithPrefixFunction · 0.85
StringMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected