SectionCodeFromImportsAndMethods generates and formats the code for given import and method definition sections.
(t *testing.T, importSection, methodSection *SectionTemplate)
| 43 | |
| 44 | // SectionCodeFromImportsAndMethods generates and formats the code for given import and method definition sections. |
| 45 | func 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 | |
| 52 | func sectionCodeWithPrefix(t *testing.T, section *SectionTemplate, prefix string) string { |
| 53 | var code bytes.Buffer |
nothing calls this directly
no test coverage detected