()
| 173 | } |
| 174 | |
| 175 | func ExampleGetContextDiffString_second() { |
| 176 | a := `one |
| 177 | two |
| 178 | three |
| 179 | four` |
| 180 | b := `zero |
| 181 | one |
| 182 | tree |
| 183 | four` |
| 184 | diff := ContextDiff{ |
| 185 | A: SplitLines(a), |
| 186 | B: SplitLines(b), |
| 187 | FromFile: "Original", |
| 188 | ToFile: "Current", |
| 189 | Context: 3, |
| 190 | Eol: "\n", |
| 191 | } |
| 192 | result, _ := GetContextDiffString(diff) |
| 193 | fmt.Printf(strings.Replace(result, "\t", " ", -1)) |
| 194 | // Output: |
| 195 | // *** Original |
| 196 | // --- Current |
| 197 | // *************** |
| 198 | // *** 1,4 **** |
| 199 | // one |
| 200 | // ! two |
| 201 | // ! three |
| 202 | // four |
| 203 | // --- 1,4 ---- |
| 204 | // + zero |
| 205 | // one |
| 206 | // ! tree |
| 207 | // four |
| 208 | } |
| 209 | |
| 210 | func rep(s string, count int) string { |
| 211 | return strings.Repeat(s, count) |
nothing calls this directly
no test coverage detected
searching dependent graphs…