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

Function sectionCodeWithPrefix

codegen/testing.go:52–62  ·  view source on GitHub ↗
(t *testing.T, section *SectionTemplate, prefix string)

Source from the content-addressed store, hash-verified

50}
51
52func sectionCodeWithPrefix(t *testing.T, section *SectionTemplate, prefix string) string {
53 var code bytes.Buffer
54 require.NoError(t, section.Write(&code))
55 codestr := code.String()
56
57 if len(prefix) > 0 {
58 codestr = fmt.Sprintf("%s\n%s", prefix, codestr)
59 }
60
61 return FormatTestCode(t, codestr)
62}
63
64// FormatTestCode formats the given Go code. The code must correspond to the
65// content of a valid Go source file (i.e. start with "package")

Callers 3

SectionCodeFunction · 0.85
SectionsCodeFunction · 0.85

Calls 3

FormatTestCodeFunction · 0.85
StringMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected