(detailOutput string, blockPrefix rune)
| 144 | } |
| 145 | |
| 146 | func (report *DiffSyntaxReport) prefixChangeBlock(detailOutput string, blockPrefix rune) string { |
| 147 | // trim newline from the end |
| 148 | detailOutput = strings.TrimSpace(detailOutput) |
| 149 | |
| 150 | var output bytes.Buffer |
| 151 | |
| 152 | // the first line is the change type, we don't want to prefix that |
| 153 | firstLine := strings.Split(detailOutput, "\n")[0] |
| 154 | // Remove the ADDITION rune from the first line |
| 155 | report.writeTextBlocks(&output, 0, firstLine) |
| 156 | |
| 157 | detailOutput = strings.Replace(detailOutput, firstLine+"\n", "", 1) |
| 158 | |
| 159 | report.writeTextBlocks(&output, 0, createStringWithContinuousPrefix(fmt.Sprintf("%c ", blockPrefix), detailOutput, 0)) |
| 160 | |
| 161 | return strings.TrimSpace(output.String()) |
| 162 | } |
no test coverage detected