(t *testing.T, section *SectionTemplate, prefix string)
| 50 | } |
| 51 | |
| 52 | func 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") |
no test coverage detected